Browse Source

1.增加combo接口
2.增加制造单后台程序

chenw 7 years ago
parent
commit
6b10f241d8
20 changed files with 1646 additions and 44 deletions
  1. 5 5
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java
  2. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java
  3. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  4. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java
  5. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  6. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  7. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  8. 4 0
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  9. 6 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  10. 36 36
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  11. 35 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/MakeListDTO.java
  12. 238 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java
  13. 141 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java
  14. 59 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java
  15. 28 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java
  16. 28 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMaterialMapper.java
  17. 67 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java
  18. 228 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  19. 370 0
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  20. 374 0
      applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml

+ 5 - 5
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java

@@ -17,7 +17,7 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
     private String wh_description;
     private String wh_statuscode;
     private String wh_status;
-    private long wh_recordid;
+    private long wh_recorderid;
     private String wh_recorder;
     /**
      * 录入日期
@@ -69,12 +69,12 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
         this.wh_status = wh_status;
     }
 
-    public long getWh_recordid() {
-        return wh_recordid;
+    public long getWh_recorderid() {
+        return wh_recorderid;
     }
 
-    public void setWh_recordid(long wh_recordid) {
-        this.wh_recordid = wh_recordid;
+    public void setWh_recorderid(long wh_recorderid) {
+        this.wh_recorderid = wh_recorderid;
     }
 
     public String getWh_recorder() {

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java

@@ -46,4 +46,9 @@ public class ProductbrandController {
         List<Productbrand> productbrandList = productbrandService.findAll();
         return Result.success(productbrandList);
     }
+
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        return Result.success(productbrandService.getCombo());
+    }
 }

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productbrand;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
 
@@ -16,4 +20,6 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
     int updateByPrimaryKeySelective(Productbrand record);
 
     int updateByPrimaryKey(Productbrand record);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java

@@ -1,9 +1,14 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productbrand;
 import com.usoftchina.saas.document.mapper.ProductbrandMapper;
 
+import java.util.List;
+
 public interface ProductbrandService extends CommonBaseService<ProductbrandMapper, Productbrand> {
 
+    List<ComboDTO> getCombo();
+
 }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -213,6 +213,6 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PRODUCT.getCaller()).getData();
     }
 }

+ 7 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productbrand;
@@ -10,6 +11,8 @@ import com.usoftchina.saas.document.service.ProductbrandService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandMapper, Productbrand> implements ProductbrandService {
 
@@ -46,4 +49,8 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         return true;
     }
 
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

+ 3 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java

@@ -69,10 +69,11 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         DocBaseDTO docBaseDTO = null;
         if(record.getId() == 0){
             String code = pushMaxnubmer(record.getWh_code(), record.getId());
-            count = getMapper().insertSelective(record);
             record.setCompanyId(BaseContextHolder.getCompanyId());
             record.setCreatorId(BaseContextHolder.getUserId());
             record.setCreateTime(new Date());
+
+            count = getMapper().insertSelective(record);
             //记录LOG
             docBaseDTO = generateMsgObj(record.getId(), code);
             messageLogService.save(docBaseDTO);
@@ -187,6 +188,6 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.WAREHOUSE.getCaller()).getData();
     }
 }

+ 4 - 0
applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml

@@ -122,4 +122,8 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM PRODUCTBRAND
   </select>
+
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+    SELECT PB_NAME display,PB_NAME value FROM PRODUCTBRAND
+  </select>
 </mapper>

+ 6 - 0
applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml

@@ -25,6 +25,9 @@
     where vk_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Vendorkind">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into vendorkind (vk_name, vk_recordid,
     vk_recorder, vk_date, companyId,
     updaterId, updateTime)
@@ -33,6 +36,9 @@
     #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorkind">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into vendorkind
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="vk_name != null">

+ 36 - 36
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -11,7 +11,7 @@
         <result column="wh_recordid" property="wh_recordid" jdbcType="INTEGER" />
         <result column="wh_recorder" property="wh_recorder" jdbcType="INTEGER" />
         <result column="wh_date" property="wh_date" jdbcType="INTEGER" />
-        <result column="companyid" property="companyId" jdbcType="INTEGER" />
+        <result column="companyId" property="companyId" jdbcType="INTEGER" />
         <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
         <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
         <result column="wh_text1" property="wh_text1" jdbcType="VARCHAR" />
@@ -30,11 +30,11 @@
         <parameter property="inoutNo" jdbcType="VARCHAR" mode="IN" />
         <parameter property="class" jdbcType="VARCHAR" mode="IN" />
         <parameter property="commitid" jdbcType="INTEGER" mode="IN" />
-        <parameter property="companyid" jdbcType="INTEGER" mode="IN" />
+        <parameter property="companyId" jdbcType="INTEGER" mode="IN" />
         <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
     </parameterMap>
     <select id="validPeriod" parameterType="map" resultType="java.lang.Short">
-        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
+        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE companyId=#{companyId} AND PD_DETNO=#{period}
     </select>
 
     <sql id="Example_Where_Clause">
@@ -97,40 +97,43 @@
     </sql>
     <sql id="Base_Column_List">
         wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
-        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_recorder, wh_date, companyId, updaterId, updateTime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="WarehouseResultMapper">
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="WarehouseResultMapper">
         select
         <include refid="Base_Column_List" />
         from warehouse
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from warehouse
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </delete>
 
     <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
-        insert into warehouse (wh_id, wh_code, wh_type,
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into warehouse (wh_code, wh_type,
         wh_description, wh_statuscode, wh_status,
         wh_recorderid, wh_recorder, wh_date,
-        companyid, updaterId, updatetime,
+        companyId, updaterId, updateTime,
         wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5)
-        values (#{wh_id,jdbcType=INTEGER}, #{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
+        values (#{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
         #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
         #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
-        #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
         #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
         #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
         insert into warehouse
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="wh_id != null">
-                wh_id,
-            </if>
             <if test="wh_code != null">
                 wh_code,
             </if>
@@ -155,14 +158,14 @@
             <if test="wh_date != null">
                 wh_date,
             </if>
-            <if test="companyid != null">
-                companyid,
+            <if test="companyId != null">
+                companyId,
             </if>
             <if test="updaterId != null">
                 updaterId,
             </if>
-            <if test="updatetime != null">
-                updatetime,
+            <if test="updateTime != null">
+                updateTime,
             </if>
             <if test="wh_text1 != null">
                 wh_text1,
@@ -181,9 +184,6 @@
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="wh_id != null">
-                #{wh_id,jdbcType=INTEGER},
-            </if>
             <if test="wh_code != null">
                 #{wh_code,jdbcType=VARCHAR},
             </if>
@@ -208,14 +208,14 @@
             <if test="wh_date != null">
                 #{wh_date,jdbcType=TIMESTAMP},
             </if>
-            <if test="companyid != null">
-                #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 #{updaterId,jdbcType=INTEGER},
             </if>
-            <if test="updatetime != null">
-                #{updatetime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
             </if>
             <if test="wh_text1 != null">
                 #{wh_text1,jdbcType=VARCHAR},
@@ -261,14 +261,14 @@
             <if test="wh_date != null">
                 wh_date = #{wh_date,jdbcType=TIMESTAMP},
             </if>
-            <if test="companyid != null">
-                companyid = #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                companyId = #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 updaterId = #{updaterId,jdbcType=INTEGER},
             </if>
-            <if test="updatetime != null">
-                updatetime = #{updatetime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                updateTime = #{updateTime,jdbcType=TIMESTAMP},
             </if>
             <if test="wh_text1 != null">
                 wh_text1 = #{wh_text1,jdbcType=VARCHAR},
@@ -286,7 +286,7 @@
                 wh_text5 = #{wh_text5,jdbcType=VARCHAR},
             </if>
         </set>
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </update>
     <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         update warehouse
@@ -298,19 +298,19 @@
         wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
         wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
         wh_date = #{wh_date,jdbcType=TIMESTAMP},
-        companyid = #{companyid,jdbcType=INTEGER},
+        companyId = #{companyId,jdbcType=INTEGER},
         updaterId = #{updaterId,jdbcType=INTEGER},
-        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
         wh_text1 = #{wh_text1,jdbcType=VARCHAR},
         wh_text2 = #{wh_text2,jdbcType=VARCHAR},
         wh_text3 = #{wh_text3,jdbcType=VARCHAR},
         wh_text4 = #{wh_text4,jdbcType=VARCHAR},
         wh_text5 = #{wh_text5,jdbcType=VARCHAR}
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </update>
 
-    <select id="selectAll" resultType="com.usoftchina.saas.document.entities.Warehouse">
-        SELECT * FROM WAREHOUSE WHERE COMPANYID = #{companyId}
+    <select id="selectAll" resultMap="WarehouseResultMapper">
+        SELECT * FROM WAREHOUSE WHERE companyId = #{companyId}
     </select>
 
     <select id="validateCodeWhenInsert" resultType="int">

+ 35 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/MakeListDTO.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.storage.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import com.usoftchina.saas.storage.po.Make;
+import com.usoftchina.saas.storage.po.MakeMaterial;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 制造单主从表传输对象
+ * @author chenwei
+ * @date 2018/10/29
+ */
+public class MakeListDTO extends CommonBaseDTO implements Serializable {
+
+    private Make main;
+    private List<MakeMaterial> items;
+
+    public Make getMain() {
+        return main;
+    }
+
+    public void setMain(Make main) {
+        this.main = main;
+    }
+
+    public List<MakeMaterial> getItems() {
+        return items;
+    }
+
+    public void setItems(List<MakeMaterial> items) {
+        this.items = items;
+    }
+}

+ 238 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java

@@ -0,0 +1,238 @@
+package com.usoftchina.saas.storage.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Make extends CommonBaseEntity implements Serializable {
+    private String ma_code;
+
+    private String ma_status;
+
+    private String ma_statuscode;
+
+    private String ma_type;
+
+    private Integer ma_prodid;
+
+    private String ma_prodcode;
+
+    private String ma_proddetail;
+
+    private String ma_prodspec;
+
+    private String ma_version;
+
+    private String ma_produnit;
+
+    private Double ma_qty;
+
+    private Integer ma_whid;
+
+    private String ma_whcode;
+
+    private Date ma_recorddate;
+
+    private Integer ma_recordid;
+
+    private String ma_recorder;
+
+    private Double ma_price;
+
+    private Double ma_total;
+
+    private String ma_text1;
+
+    private String ma_text2;
+
+    private String ma_text3;
+
+    private String ma_text4;
+
+    private String ma_text5;
+
+    public String getMa_code() {
+        return ma_code;
+    }
+
+    public void setMa_code(String ma_code) {
+        this.ma_code = ma_code == null ? null : ma_code.trim();
+    }
+
+    public String getMa_status() {
+        return ma_status;
+    }
+
+    public void setMa_status(String ma_status) {
+        this.ma_status = ma_status == null ? null : ma_status.trim();
+    }
+
+    public String getMa_statuscode() {
+        return ma_statuscode;
+    }
+
+    public void setMa_statuscode(String ma_statuscode) {
+        this.ma_statuscode = ma_statuscode == null ? null : ma_statuscode.trim();
+    }
+
+    public String getMa_type() {
+        return ma_type;
+    }
+
+    public void setMa_type(String ma_type) {
+        this.ma_type = ma_type == null ? null : ma_type.trim();
+    }
+
+    public Integer getMa_prodid() {
+        return ma_prodid;
+    }
+
+    public void setMa_prodid(Integer ma_prodid) {
+        this.ma_prodid = ma_prodid;
+    }
+
+    public String getMa_prodcode() {
+        return ma_prodcode;
+    }
+
+    public void setMa_prodcode(String ma_prodcode) {
+        this.ma_prodcode = ma_prodcode == null ? null : ma_prodcode.trim();
+    }
+
+    public String getMa_proddetail() {
+        return ma_proddetail;
+    }
+
+    public void setMa_proddetail(String ma_proddetail) {
+        this.ma_proddetail = ma_proddetail == null ? null : ma_proddetail.trim();
+    }
+
+    public String getMa_prodspec() {
+        return ma_prodspec;
+    }
+
+    public void setMa_prodspec(String ma_prodspec) {
+        this.ma_prodspec = ma_prodspec == null ? null : ma_prodspec.trim();
+    }
+
+    public String getMa_version() {
+        return ma_version;
+    }
+
+    public void setMa_version(String ma_version) {
+        this.ma_version = ma_version == null ? null : ma_version.trim();
+    }
+
+    public String getMa_produnit() {
+        return ma_produnit;
+    }
+
+    public void setMa_produnit(String ma_produnit) {
+        this.ma_produnit = ma_produnit == null ? null : ma_produnit.trim();
+    }
+
+    public Double getMa_qty() {
+        return ma_qty;
+    }
+
+    public void setMa_qty(Double ma_qty) {
+        this.ma_qty = ma_qty;
+    }
+
+    public Integer getMa_whid() {
+        return ma_whid;
+    }
+
+    public void setMa_whid(Integer ma_whid) {
+        this.ma_whid = ma_whid;
+    }
+
+    public String getMa_whcode() {
+        return ma_whcode;
+    }
+
+    public void setMa_whcode(String ma_whcode) {
+        this.ma_whcode = ma_whcode == null ? null : ma_whcode.trim();
+    }
+
+    public Date getMa_recorddate() {
+        return ma_recorddate;
+    }
+
+    public void setMa_recorddate(Date ma_recorddate) {
+        this.ma_recorddate = ma_recorddate;
+    }
+
+    public Integer getMa_recordid() {
+        return ma_recordid;
+    }
+
+    public void setMa_recordid(Integer ma_recordid) {
+        this.ma_recordid = ma_recordid;
+    }
+
+    public String getMa_recorder() {
+        return ma_recorder;
+    }
+
+    public void setMa_recorder(String ma_recorder) {
+        this.ma_recorder = ma_recorder == null ? null : ma_recorder.trim();
+    }
+
+    public Double getMa_price() {
+        return ma_price;
+    }
+
+    public void setMa_price(Double ma_price) {
+        this.ma_price = ma_price;
+    }
+
+    public Double getMa_total() {
+        return ma_total;
+    }
+
+    public void setMa_total(Double ma_total) {
+        this.ma_total = ma_total;
+    }
+
+    public String getMa_text1() {
+        return ma_text1;
+    }
+
+    public void setMa_text1(String ma_text1) {
+        this.ma_text1 = ma_text1 == null ? null : ma_text1.trim();
+    }
+
+    public String getMa_text2() {
+        return ma_text2;
+    }
+
+    public void setMa_text2(String ma_text2) {
+        this.ma_text2 = ma_text2 == null ? null : ma_text2.trim();
+    }
+
+    public String getMa_text3() {
+        return ma_text3;
+    }
+
+    public void setMa_text3(String ma_text3) {
+        this.ma_text3 = ma_text3 == null ? null : ma_text3.trim();
+    }
+
+    public String getMa_text4() {
+        return ma_text4;
+    }
+
+    public void setMa_text4(String ma_text4) {
+        this.ma_text4 = ma_text4 == null ? null : ma_text4.trim();
+    }
+
+    public String getMa_text5() {
+        return ma_text5;
+    }
+
+    public void setMa_text5(String ma_text5) {
+        this.ma_text5 = ma_text5 == null ? null : ma_text5.trim();
+    }
+}

+ 141 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java

@@ -0,0 +1,141 @@
+package com.usoftchina.saas.storage.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 制造单明细
+ * @author chenwei
+ * @date 2018/10/29
+ */
+public class MakeMaterial extends CommonBaseEntity implements Serializable {
+    private Long mm_maid;
+
+    private Integer mm_detno;
+
+    private Integer mm_prodid;
+
+    private String mm_prodcode;
+
+    private Integer mm_whid;
+
+    private String mm_whcode;
+
+    private Double mm_price;
+
+    private Double mm_oneuseqty;
+
+    private Double mm_qty;
+
+    private Double mm_amount;
+
+    private String mm_repprodcode;
+
+    private String mm_remark;
+
+    public Long getMm_maid() {
+        return mm_maid;
+    }
+
+    public void setMm_maid(Long mm_maid) {
+        this.mm_maid = mm_maid;
+    }
+
+    public Integer getMm_detno() {
+        return mm_detno;
+    }
+
+    public void setMm_detno(Integer mm_detno) {
+        this.mm_detno = mm_detno;
+    }
+
+    public Integer getMm_prodid() {
+        return mm_prodid;
+    }
+
+    public void setMm_prodid(Integer mm_prodid) {
+        this.mm_prodid = mm_prodid;
+    }
+
+    public String getMm_prodcode() {
+        return mm_prodcode;
+    }
+
+    public void setMm_prodcode(String mm_prodcode) {
+        this.mm_prodcode = mm_prodcode == null ? null : mm_prodcode.trim();
+    }
+
+    public Integer getMm_whid() {
+        return mm_whid;
+    }
+
+    public void setMm_whid(Integer mm_whid) {
+        this.mm_whid = mm_whid;
+    }
+
+    public String getMm_whcode() {
+        return mm_whcode;
+    }
+
+    public void setMm_whcode(String mm_whcode) {
+        this.mm_whcode = mm_whcode == null ? null : mm_whcode.trim();
+    }
+
+    public Double getMm_price() {
+        return mm_price;
+    }
+
+    public void setMm_price(Double mm_price) {
+        this.mm_price = mm_price;
+    }
+
+    public Double getMm_oneuseqty() {
+        return mm_oneuseqty;
+    }
+
+    public void setMm_oneuseqty(Double mm_oneuseqty) {
+        this.mm_oneuseqty = mm_oneuseqty;
+    }
+
+    public Double getMm_qty() {
+        return mm_qty;
+    }
+
+    public void setMm_qty(Double mm_qty) {
+        this.mm_qty = mm_qty;
+    }
+
+    public Double getMm_amount() {
+        return mm_amount;
+    }
+
+    public void setMm_amount(Double mm_amount) {
+        this.mm_amount = mm_amount;
+    }
+
+    public String getMm_repprodcode() {
+        return mm_repprodcode;
+    }
+
+    public void setMm_repprodcode(String mm_repprodcode) {
+        this.mm_repprodcode = mm_repprodcode == null ? null : mm_repprodcode.trim();
+    }
+
+    public String getMm_remark() {
+        return mm_remark;
+    }
+
+    public void setMm_remark(String mm_remark) {
+        this.mm_remark = mm_remark == null ? null : mm_remark.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 59 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java

@@ -0,0 +1,59 @@
+package com.usoftchina.saas.storage.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.MakeListDTO;
+import com.usoftchina.saas.storage.service.MakeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/make")
+public class MakeController {
+
+    @Autowired
+    private MakeService makeService;
+
+    @GetMapping("/list")
+    public Result getFormItems(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(makeService.getList(page, listReqDTO));
+    }
+
+    @GetMapping("/read/{id}")
+    public Result getDataById(@PathVariable("id") Long id){
+        MakeListDTO makeListDTO = makeService.getDataById(id);
+        return Result.success(makeListDTO);
+    }
+
+    @PostMapping("/save")
+    public Result save(@RequestBody MakeListDTO makeListDTO){
+        DocBaseDTO docBaseDTO = makeService.saveOrUpdate(makeListDTO);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        makeService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id){
+        makeService.deleteDetail(id);
+        return Result.success();
+    }
+
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = makeService.close(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = makeService.open(id);
+        return Result.success(docBaseDTO);
+    }
+}

+ 28 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.storage.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.storage.po.Make;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MakeMapper extends CommonBaseMapper<Make> {
+    int deleteByPrimaryKey(Long ma_id);
+
+    int insert(Make record);
+
+    int insertSelective(Make record);
+
+    Make selectByPrimaryKey(Long ma_id);
+
+    int updateByPrimaryKeySelective(Make record);
+
+    int updateByPrimaryKey(Make record);
+
+    List<Make> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
+
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+
+}

+ 28 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMaterialMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.storage.mapper;
+
+import com.usoftchina.saas.storage.po.MakeMaterial;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MakeMaterialMapper {
+    int deleteByPrimaryKey(Long mm_id);
+
+    int insert(MakeMaterial record);
+
+    int insertSelective(MakeMaterial record);
+
+    MakeMaterial selectByPrimaryKey(Long mm_id);
+
+    int updateByPrimaryKeySelective(MakeMaterial record);
+
+    int updateByPrimaryKey(MakeMaterial record);
+
+    List<MakeMaterial> selectByFK(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    boolean deleteByFK(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    void batchInsert(List<MakeMaterial> vendorcontactList);
+
+    void batchUpdate(List<MakeMaterial> vendorcontactList);
+}

+ 67 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java

@@ -0,0 +1,67 @@
+package com.usoftchina.saas.storage.service;
+
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.MakeListDTO;
+import com.usoftchina.saas.storage.mapper.MakeMapper;
+import com.usoftchina.saas.storage.po.Make;
+
+import java.util.List;
+
+public interface MakeService extends CommonBaseService<MakeMapper, Make> {
+
+    /**
+     * 列表
+     * @param page  分页对象
+     * @param listReqDTO    条件对象
+     * @return
+     */
+    PageInfo<Make> getList(PageRequest page, ListReqDTO listReqDTO);
+
+    /**
+     * 获取主从表数据
+     * @param id    主表ID
+     * @return
+     */
+    MakeListDTO getDataById(Long id);
+
+    /**
+     * 保存、更新
+     * @param makeListDTO
+     * @return
+     */
+    DocBaseDTO saveOrUpdate(MakeListDTO makeListDTO);
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    DocBaseDTO close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    DocBaseDTO open(Long id);
+
+    /**
+     *
+     * 删除
+     * @param id
+     * @return
+     */
+    boolean delete(Long id);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    boolean deleteDetail(Long id);
+}

+ 228 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -0,0 +1,228 @@
+package com.usoftchina.saas.storage.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Status;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.MakeListDTO;
+import com.usoftchina.saas.storage.mapper.MakeMapper;
+import com.usoftchina.saas.storage.mapper.MakeMaterialMapper;
+import com.usoftchina.saas.storage.po.Make;
+import com.usoftchina.saas.storage.po.MakeMaterial;
+import com.usoftchina.saas.storage.service.MakeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> implements MakeService {
+
+    @Autowired
+    private MakeMaterialMapper makeMaterialMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
+    @Autowired
+    private MessageLogService messageLogService;
+
+    @Override
+    public PageInfo<Make> getList(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //取分页信息
+        String condition = listReqDTO.getFinalCondition();
+        List<Make> list = getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+        PageInfo<Make> pageInfo = new PageInfo<Make>(list);
+        return pageInfo;
+    }
+
+    @Override
+    public MakeListDTO getDataById(Long id) {
+        Make make = getMapper().selectByPrimaryKey(id);
+        List<MakeMaterial> makeMaterialList = makeMaterialMapper.selectByFK(id, BaseContextHolder.getCompanyId());
+        MakeListDTO makeListDTO = new MakeListDTO();
+        makeListDTO.setMain(make);
+        makeListDTO.setItems(makeMaterialList);
+        return makeListDTO;
+    }
+
+    @Override
+    @Transactional
+    public DocBaseDTO saveOrUpdate(MakeListDTO makeListDTO) {
+        //校验库存是否足够
+        validStorage(makeListDTO);
+
+        Make make = makeListDTO.getMain();
+        List<MakeMaterial> makeMaterialList = makeListDTO.getItems();
+        DocBaseDTO docBaseDTO = null;
+
+        if(make.getId() == 0){
+            //保存主表
+            String code = pushMaxnubmer(make.getMa_code(), make.getId());
+            make.setMa_code(code);
+            make.setCompanyId(BaseContextHolder.getCompanyId());
+            make.setCreateTime(new Date());
+            make.setCreatorId(BaseContextHolder.getUserId());
+
+            getMapper().insertSelective(make);
+            //保存明细
+            for (MakeMaterial makeMaterial : makeMaterialList){
+                makeMaterial.setMm_maid(make.getId());
+                makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                makeMaterial.setCreatorId(BaseContextHolder.getUserId());
+                makeMaterial.setCreateTime(new Date());
+
+            }
+            makeMaterialMapper.batchInsert(makeMaterialList);
+            //记录LOG
+            docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
+            messageLogService.save(docBaseDTO);
+        }else{
+            //更新主表
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            getMapper().updateByPrimaryKeySelective(make);
+
+            List<MakeMaterial> updateItems = new ArrayList<MakeMaterial>();
+            List<MakeMaterial> insertItems = new ArrayList<MakeMaterial>();
+            //更新从表
+            for (MakeMaterial makeMaterial : makeMaterialList){
+                if(makeMaterial.getId() == 0){
+                    makeMaterial.setCreatorId(BaseContextHolder.getUserId());
+                    makeMaterial.setCreateTime(new Date());
+                    makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                    insertItems.add(makeMaterial);
+                }else{
+                    makeMaterial.setUpdaterId(BaseContextHolder.getUserId());
+                    makeMaterial.setUpdateTime(new Date());
+                    makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                    updateItems.add(makeMaterial);
+                }
+            }
+            //执行插入、更新
+            makeMaterialMapper.batchInsert(insertItems);
+            makeMaterialMapper.batchUpdate(updateItems);
+            //记录LOG
+            docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
+            messageLogService.update(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
+    /**
+     * 校验库存是否足够
+     * @param makeListDTO
+     */
+    private void validStorage(MakeListDTO makeListDTO) {
+        Make make = makeListDTO.getMain();
+        List<MakeMaterial> makeMaterialList = makeListDTO.getItems();
+        if ("组装".equals(make.getMa_type())){
+            //判断明细的库存是否足够
+            for(MakeMaterial makeMaterial : makeMaterialList){
+                double qty = makeMaterial.getMm_qty() * makeMaterial.getMm_oneuseqty();
+            }
+        }else if ("拆件".equals(make.getMa_type())){
+            double qty = make.getMa_qty();
+
+        }
+    }
+
+    @Override
+    public DocBaseDTO close(Long id) {
+        if(id != null && id > 0){
+            Make make = new Make();
+            make.setId(id);
+            make.setMa_status(Status.CLOSE.getDisplay());
+            make.setMa_statuscode(Status.CLOSE.name());
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getMa_code();
+            getMapper().updateByPrimaryKeySelective(make);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public DocBaseDTO open(Long id) {
+        if(id != null && id > 0){
+            Make make = new Make();
+            make.setId(id);
+            make.setMa_status(Status.OPEN.getDisplay());
+            make.setMa_statuscode(Status.OPEN.name());
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getMa_code();
+            getMapper().updateByPrimaryKeySelective(make);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.open(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public boolean delete(Long id) {
+        getMapper().deleteByPrimaryKey(id);
+        makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        return true;
+    }
+
+    @Override
+    public boolean deleteDetail(Long id) {
+        makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        return true;
+    }
+
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Make");
+    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: chenwei
+     * @Date: 2018/10/26
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                getMapper().validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.MAKE.getCaller()).getData();
+    }
+}

+ 370 - 0
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -0,0 +1,370 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.storage.mapper.MakeMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.Make" >
+    <id column="ma_id" property="id" jdbcType="INTEGER" />
+    <result column="ma_code" property="ma_code" jdbcType="VARCHAR" />
+    <result column="ma_status" property="ma_status" jdbcType="VARCHAR" />
+    <result column="ma_statuscode" property="ma_statuscode" jdbcType="VARCHAR" />
+    <result column="ma_type" property="ma_type" jdbcType="VARCHAR" />
+    <result column="ma_prodid" property="ma_prodid" jdbcType="INTEGER" />
+    <result column="ma_prodcode" property="ma_prodcode" jdbcType="VARCHAR" />
+    <result column="ma_proddetail" property="ma_proddetail" jdbcType="VARCHAR" />
+    <result column="ma_prodspec" property="ma_prodspec" jdbcType="VARCHAR" />
+    <result column="ma_version" property="ma_version" jdbcType="VARCHAR" />
+    <result column="ma_produnit" property="ma_produnit" jdbcType="VARCHAR" />
+    <result column="ma_qty" property="ma_qty" jdbcType="DOUBLE" />
+    <result column="ma_whid" property="ma_whid" jdbcType="INTEGER" />
+    <result column="ma_whcode" property="ma_whcode" jdbcType="VARCHAR" />
+    <result column="ma_recorddate" property="ma_recorddate" jdbcType="TIMESTAMP" />
+    <result column="ma_recordid" property="ma_recordid" jdbcType="INTEGER" />
+    <result column="ma_recorder" property="ma_recorder" jdbcType="VARCHAR" />
+    <result column="ma_price" property="ma_price" jdbcType="DOUBLE" />
+    <result column="ma_total" property="ma_total" jdbcType="DOUBLE" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="ma_text1" property="ma_text1" jdbcType="VARCHAR" />
+    <result column="ma_text2" property="ma_text2" jdbcType="VARCHAR" />
+    <result column="ma_text3" property="ma_text3" jdbcType="VARCHAR" />
+    <result column="ma_text4" property="ma_text4" jdbcType="VARCHAR" />
+    <result column="ma_text5" property="ma_text5" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail, 
+    ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_recorddate, 
+    ma_recordid, ma_recorder, ma_price, ma_total, companyId, updaterId, updateTime, ma_text1, 
+    ma_text2, ma_text3, ma_text4, ma_text5
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from make
+    where ma_id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from make
+    where ma_id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.Make" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into make (ma_code, ma_status, 
+      ma_statuscode, ma_type, ma_prodid, 
+      ma_prodcode, ma_proddetail, ma_prodspec, 
+      ma_version, ma_produnit, ma_qty, 
+      ma_whid, ma_whcode, ma_recorddate, 
+      ma_recordid, ma_recorder, ma_price, 
+      ma_total, companyId, updaterId, 
+      updateTime, ma_text1, ma_text2, 
+      ma_text3, ma_text4, ma_text5
+      )
+    values (#{ma_code,jdbcType=VARCHAR}, #{ma_status,jdbcType=VARCHAR}, 
+      #{ma_statuscode,jdbcType=VARCHAR}, #{ma_type,jdbcType=VARCHAR}, #{ma_prodid,jdbcType=INTEGER}, 
+      #{ma_prodcode,jdbcType=VARCHAR}, #{ma_proddetail,jdbcType=VARCHAR}, #{ma_prodspec,jdbcType=VARCHAR}, 
+      #{ma_version,jdbcType=VARCHAR}, #{ma_produnit,jdbcType=VARCHAR}, #{ma_qty,jdbcType=DOUBLE}, 
+      #{ma_whid,jdbcType=INTEGER}, #{ma_whcode,jdbcType=VARCHAR}, #{ma_recorddate,jdbcType=TIMESTAMP}, 
+      #{ma_recordid,jdbcType=INTEGER}, #{ma_recorder,jdbcType=VARCHAR}, #{ma_price,jdbcType=DOUBLE}, 
+      #{ma_total,jdbcType=DOUBLE}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{ma_text1,jdbcType=VARCHAR}, #{ma_text2,jdbcType=VARCHAR}, 
+      #{ma_text3,jdbcType=VARCHAR}, #{ma_text4,jdbcType=VARCHAR}, #{ma_text5,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.Make" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into make
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ma_code != null" >
+        ma_code,
+      </if>
+      <if test="ma_status != null" >
+        ma_status,
+      </if>
+      <if test="ma_statuscode != null" >
+        ma_statuscode,
+      </if>
+      <if test="ma_type != null" >
+        ma_type,
+      </if>
+      <if test="ma_prodid != null" >
+        ma_prodid,
+      </if>
+      <if test="ma_prodcode != null" >
+        ma_prodcode,
+      </if>
+      <if test="ma_proddetail != null" >
+        ma_proddetail,
+      </if>
+      <if test="ma_prodspec != null" >
+        ma_prodspec,
+      </if>
+      <if test="ma_version != null" >
+        ma_version,
+      </if>
+      <if test="ma_produnit != null" >
+        ma_produnit,
+      </if>
+      <if test="ma_qty != null" >
+        ma_qty,
+      </if>
+      <if test="ma_whid != null" >
+        ma_whid,
+      </if>
+      <if test="ma_whcode != null" >
+        ma_whcode,
+      </if>
+      <if test="ma_recorddate != null" >
+        ma_recorddate,
+      </if>
+      <if test="ma_recordid != null" >
+        ma_recordid,
+      </if>
+      <if test="ma_recorder != null" >
+        ma_recorder,
+      </if>
+      <if test="ma_price != null" >
+        ma_price,
+      </if>
+      <if test="ma_total != null" >
+        ma_total,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="ma_text1 != null" >
+        ma_text1,
+      </if>
+      <if test="ma_text2 != null" >
+        ma_text2,
+      </if>
+      <if test="ma_text3 != null" >
+        ma_text3,
+      </if>
+      <if test="ma_text4 != null" >
+        ma_text4,
+      </if>
+      <if test="ma_text5 != null" >
+        ma_text5,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ma_code != null" >
+        #{ma_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_status != null" >
+        #{ma_status,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_statuscode != null" >
+        #{ma_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_type != null" >
+        #{ma_type,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodid != null" >
+        #{ma_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_prodcode != null" >
+        #{ma_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_proddetail != null" >
+        #{ma_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodspec != null" >
+        #{ma_prodspec,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_version != null" >
+        #{ma_version,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_produnit != null" >
+        #{ma_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_qty != null" >
+        #{ma_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_whid != null" >
+        #{ma_whid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_whcode != null" >
+        #{ma_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_recorddate != null" >
+        #{ma_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_recordid != null" >
+        #{ma_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_recorder != null" >
+        #{ma_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_price != null" >
+        #{ma_price,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_total != null" >
+        #{ma_total,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_text1 != null" >
+        #{ma_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text2 != null" >
+        #{ma_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text3 != null" >
+        #{ma_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text4 != null" >
+        #{ma_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text5 != null" >
+        #{ma_text5,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.Make" >
+    update make
+    <set >
+      <if test="ma_code != null" >
+        ma_code = #{ma_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_status != null" >
+        ma_status = #{ma_status,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_statuscode != null" >
+        ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_type != null" >
+        ma_type = #{ma_type,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodid != null" >
+        ma_prodid = #{ma_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_prodcode != null" >
+        ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_proddetail != null" >
+        ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodspec != null" >
+        ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_version != null" >
+        ma_version = #{ma_version,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_produnit != null" >
+        ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_qty != null" >
+        ma_qty = #{ma_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_whid != null" >
+        ma_whid = #{ma_whid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_whcode != null" >
+        ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_recorddate != null" >
+        ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_recordid != null" >
+        ma_recordid = #{ma_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_recorder != null" >
+        ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_price != null" >
+        ma_price = #{ma_price,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_total != null" >
+        ma_total = #{ma_total,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_text1 != null" >
+        ma_text1 = #{ma_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text2 != null" >
+        ma_text2 = #{ma_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text3 != null" >
+        ma_text3 = #{ma_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text4 != null" >
+        ma_text4 = #{ma_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text5 != null" >
+        ma_text5 = #{ma_text5,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ma_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.Make" >
+    update make
+    set ma_code = #{ma_code,jdbcType=VARCHAR},
+      ma_status = #{ma_status,jdbcType=VARCHAR},
+      ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
+      ma_type = #{ma_type,jdbcType=VARCHAR},
+      ma_prodid = #{ma_prodid,jdbcType=INTEGER},
+      ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
+      ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
+      ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
+      ma_version = #{ma_version,jdbcType=VARCHAR},
+      ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
+      ma_qty = #{ma_qty,jdbcType=DOUBLE},
+      ma_whid = #{ma_whid,jdbcType=INTEGER},
+      ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
+      ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
+      ma_recordid = #{ma_recordid,jdbcType=INTEGER},
+      ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
+      ma_price = #{ma_price,jdbcType=DOUBLE},
+      ma_total = #{ma_total,jdbcType=DOUBLE},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ma_text1 = #{ma_text1,jdbcType=VARCHAR},
+      ma_text2 = #{ma_text2,jdbcType=VARCHAR},
+      ma_text3 = #{ma_text3,jdbcType=VARCHAR},
+      ma_text4 = #{ma_text4,jdbcType=VARCHAR},
+      ma_text5 = #{ma_text5,jdbcType=VARCHAR}
+    where ma_id = #{id}
+  </update>
+  <select id="getListDataByCondition" resultMap="BaseResultMap">
+    SELECT * FROM MAKE
+    <where>
+      <if test="condition!=null">
+        ${condition}
+      </if>
+      AND MAKE.COMPANYID = #{companyId}
+    </where>
+    order by MA_ID
+  </select>
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(*) from MAKE where MA_CODE = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(*) from MAKE where MA_CODE = #{code} and MA_ID != #{id} and companyId =#{companyId}
+  </select>
+</mapper>

+ 374 - 0
applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml

@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.storage.mapper.MakeMaterialMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.MakeMaterial" >
+    <id column="mm_id" property="id" jdbcType="INTEGER" />
+    <result column="mm_maid" property="mm_maid" jdbcType="INTEGER" />
+    <result column="mm_detno" property="mm_detno" jdbcType="INTEGER" />
+    <result column="mm_prodid" property="mm_prodid" jdbcType="INTEGER" />
+    <result column="mm_prodcode" property="mm_prodcode" jdbcType="VARCHAR" />
+    <result column="mm_whid" property="mm_whid" jdbcType="INTEGER" />
+    <result column="mm_whcode" property="mm_whcode" jdbcType="VARCHAR" />
+    <result column="mm_price" property="mm_price" jdbcType="DOUBLE" />
+    <result column="mm_oneuseqty" property="mm_oneuseqty" jdbcType="DOUBLE" />
+    <result column="mm_qty" property="mm_qty" jdbcType="DOUBLE" />
+    <result column="mm_amount" property="mm_amount" jdbcType="DOUBLE" />
+    <result column="mm_repprodcode" property="mm_repprodcode" jdbcType="VARCHAR" />
+    <result column="mm_remark" property="mm_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    mm_id, mm_maid, mm_detno, mm_prodid, mm_prodcode, mm_whid, mm_whcode, mm_price, mm_oneuseqty, 
+    mm_qty, mm_amount, mm_repprodcode, mm_remark, companyId, updaterId, updateTime
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from MakeMaterial
+    where mm_id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from MakeMaterial
+    where mm_id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    insert into MakeMaterial (mm_maid, mm_detno,
+      mm_prodid, mm_prodcode, mm_whid, 
+      mm_whcode, mm_price, mm_oneuseqty, 
+      mm_qty, mm_amount, mm_repprodcode, 
+      mm_remark, companyId, updaterId, 
+      updateTime)
+    values (#{mm_maid}, #{mm_detno,jdbcType=INTEGER},
+      #{mm_prodid,jdbcType=INTEGER}, #{mm_prodcode,jdbcType=VARCHAR}, #{mm_whid,jdbcType=INTEGER}, 
+      #{mm_whcode,jdbcType=VARCHAR}, #{mm_price,jdbcType=DOUBLE}, #{mm_oneuseqty,jdbcType=DOUBLE}, 
+      #{mm_qty,jdbcType=DOUBLE}, #{mm_amount,jdbcType=DOUBLE}, #{mm_repprodcode,jdbcType=VARCHAR}, 
+      #{mm_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    insert into MakeMaterial
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="mm_maid != null" >
+        mm_maid,
+      </if>
+      <if test="mm_detno != null" >
+        mm_detno,
+      </if>
+      <if test="mm_prodid != null" >
+        mm_prodid,
+      </if>
+      <if test="mm_prodcode != null" >
+        mm_prodcode,
+      </if>
+      <if test="mm_whid != null" >
+        mm_whid,
+      </if>
+      <if test="mm_whcode != null" >
+        mm_whcode,
+      </if>
+      <if test="mm_price != null" >
+        mm_price,
+      </if>
+      <if test="mm_oneuseqty != null" >
+        mm_oneuseqty,
+      </if>
+      <if test="mm_qty != null" >
+        mm_qty,
+      </if>
+      <if test="mm_amount != null" >
+        mm_amount,
+      </if>
+      <if test="mm_repprodcode != null" >
+        mm_repprodcode,
+      </if>
+      <if test="mm_remark != null" >
+        mm_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="mm_maid != null" >
+        #{mm_maid},
+      </if>
+      <if test="mm_detno != null" >
+        #{mm_detno,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodid != null" >
+        #{mm_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodcode != null" >
+        #{mm_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_whid != null" >
+        #{mm_whid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_whcode != null" >
+        #{mm_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_price != null" >
+        #{mm_price,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_oneuseqty != null" >
+        #{mm_oneuseqty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_qty != null" >
+        #{mm_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_amount != null" >
+        #{mm_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_repprodcode != null" >
+        #{mm_repprodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_remark != null" >
+        #{mm_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    update MakeMaterial
+    <set >
+      <if test="mm_maid != null" >
+        mm_maid = #{mm_maid},
+      </if>
+      <if test="mm_detno != null" >
+        mm_detno = #{mm_detno,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodid != null" >
+        mm_prodid = #{mm_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodcode != null" >
+        mm_prodcode = #{mm_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_whid != null" >
+        mm_whid = #{mm_whid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_whcode != null" >
+        mm_whcode = #{mm_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_price != null" >
+        mm_price = #{mm_price,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_oneuseqty != null" >
+        mm_oneuseqty = #{mm_oneuseqty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_qty != null" >
+        mm_qty = #{mm_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_amount != null" >
+        mm_amount = #{mm_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_repprodcode != null" >
+        mm_repprodcode = #{mm_repprodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_remark != null" >
+        mm_remark = #{mm_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where mm_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    update MakeMaterial
+    set mm_maid = #{mm_maid},
+      mm_detno = #{mm_detno,jdbcType=INTEGER},
+      mm_prodid = #{mm_prodid,jdbcType=INTEGER},
+      mm_prodcode = #{mm_prodcode,jdbcType=VARCHAR},
+      mm_whid = #{mm_whid,jdbcType=INTEGER},
+      mm_whcode = #{mm_whcode,jdbcType=VARCHAR},
+      mm_price = #{mm_price,jdbcType=DOUBLE},
+      mm_oneuseqty = #{mm_oneuseqty,jdbcType=DOUBLE},
+      mm_qty = #{mm_qty,jdbcType=DOUBLE},
+      mm_amount = #{mm_amount,jdbcType=DOUBLE},
+      mm_repprodcode = #{mm_repprodcode,jdbcType=VARCHAR},
+      mm_remark = #{mm_remark,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP}
+    where mm_id = #{id}
+  </update>
+  <select id="selectByFK" resultMap="BaseResultMap">
+    SELECT * FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+  </select>
+  <delete id="deleteByFK">
+    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+  </delete>
+  <insert id="batchInsert" parameterType="java.util.List">
+    <foreach collection="list" item="item" separator=",">
+      INSERT INTO MAKEMATERIAL
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.mm_maid != null" >
+          mm_maid,
+        </if>
+        <if test="item.mm_detno != null" >
+          mm_detno,
+        </if>
+        <if test="item.mm_prodid != null" >
+          mm_prodid,
+        </if>
+        <if test="item.mm_prodcode != null" >
+          mm_prodcode,
+        </if>
+        <if test="item.mm_whid != null" >
+          mm_whid,
+        </if>
+        <if test="item.mm_whcode != null" >
+          mm_whcode,
+        </if>
+        <if test="item.mm_price != null" >
+          mm_price,
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          mm_oneuseqty,
+        </if>
+        <if test="item.mm_qty != null" >
+          mm_qty,
+        </if>
+        <if test="item.mm_amount != null" >
+          mm_amount,
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          mm_repprodcode,
+        </if>
+        <if test="item.mm_remark != null" >
+          mm_remark,
+        </if>
+        <if test="item.companyId != null" >
+          companyId,
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId,
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime,
+        </if>
+      </trim>
+      <trim prefix="values(" suffix=")" suffixOverrides=",">
+        <if test="item.mm_maid != null" >
+          #{item.mm_maid},
+        </if>
+        <if test="item.mm_detno != null" >
+          #{item.mm_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodid != null" >
+          #{item.mm_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodcode != null" >
+          #{item.mm_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_whid != null" >
+          #{item.mm_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_whcode != null" >
+          #{item.mm_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_price != null" >
+          #{item.mm_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          #{item.mm_oneuseqty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_qty != null" >
+          #{item.mm_qty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_amount != null" >
+          #{item.mm_amount,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          #{item.mm_repprodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_remark != null" >
+          #{item.mm_remark,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+      </trim>
+    </foreach>
+  </insert>
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.MakeMaterial">
+    <foreach collection="list" item="item" index="index" separator=";">
+      UPDATE MakeMaterial
+      <set>
+        <if test="item.mm_maid != null" >
+          mm_maid = #{item.mm_maid},
+        </if>
+        <if test="item.mm_detno != null" >
+          mm_detno = #{item.mm_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodid != null" >
+          mm_prodid = #{item.mm_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodcode != null" >
+          mm_prodcode = #{item.mm_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_whid != null" >
+          mm_whid = #{item.mm_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_whcode != null" >
+          mm_whcode = #{item.mm_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_price != null" >
+          mm_price = #{item.mm_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          mm_oneuseqty = #{item.mm_oneuseqty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_qty != null" >
+          mm_qty = #{item.mm_qty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_amount != null" >
+          mm_amount = #{item.mm_amount,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          mm_repprodcode = #{item.mm_repprodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_remark != null" >
+          mm_remark = #{item.mm_remark,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          companyId = #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId = #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+      </set>
+    </foreach>
+  </update>
+</mapper>