Ver código fonte

销售代码更新,加上事务

guq 7 anos atrás
pai
commit
371dc60c36

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -29,6 +29,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_ALL_TURNOUT(72000, "该销售单已全部转出货,无法转出货单"),
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
+    SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
     //资金
 
     //库存

+ 6 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -24,6 +24,7 @@ import com.usoftchina.saas.purchase.service.PurchaseService;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
@@ -90,6 +91,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
+    @Transactional
     public DocBaseDTO saveFormData(PurchaseFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
@@ -168,11 +170,13 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
+    @Transactional
     public void delete(Long id) {
         singleDelete(id);
     }
 
     @Override
+    @Transactional
     public int deleteDetail(Long id) {
        Integer num = purchasedetailMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -182,6 +186,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
+    @Transactional
     public DocBaseDTO audit(PurchaseFormDTO formData) {
         Long id = null;
         DocBaseDTO baseDTO = null;
@@ -308,6 +313,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
+    @Transactional
     public Result turnProdin(Long id) {
         Purchase purchase = getMapper().selectByPrimaryKey(id);
 

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -157,7 +157,7 @@ public class SaleController {
         return Result.success();
     }
 
-    @PostMapping("/turnProdOut/{id}")
+    @GetMapping("/turnProdOut/{id}")
     public Result turnOut(@PathVariable("id") Long id) {
         saleService.turnOut(id);
         return Result.success();

+ 12 - 7
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -29,6 +29,7 @@ import com.usoftchina.saas.storage.entities.ProdInOut;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.security.MessageDigest;
@@ -94,6 +95,7 @@ public class SaleServiceImpl implements SaleService{
     }
 
     @Override
+    @Transactional
     public DocBaseDTO saveFormData(SaleFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
@@ -171,6 +173,7 @@ public class SaleServiceImpl implements SaleService{
     }
 
     @Override
+    @Transactional
     public void delete(Long id) {
         singleDelete(id);
     }
@@ -185,6 +188,7 @@ public class SaleServiceImpl implements SaleService{
     }
 
     @Override
+    @Transactional
     public DocBaseDTO audit(SaleFormDTO formData) {
         Long id = null;
         DocBaseDTO baseDTO = null;
@@ -347,6 +351,7 @@ public class SaleServiceImpl implements SaleService{
     }
 
     @Override
+    @Transactional
     public void open(long id) {
         List<SaleDetail> saleDetailList = saledetailMapper.selectByFK(id);
         //部分入库、全部入库
@@ -383,15 +388,16 @@ public class SaleServiceImpl implements SaleService{
     }
 
     @Override
+    @Transactional
     public void turnOut(Long id) {
-        if (null == id) {
-            return;
-        }
         Integer count = 0;
         double pdQty = 0;
         double pdYqty = 0;
         Sale sale = saleMapper.selectByPrimaryKey(id);
         List<SaleDetail> details = saledetailMapper.selectByFK(id);
+        if (null == sale || StringUtils.isEmpty(sale.getSa_code()) || details.size() == 0) {
+            throw new BizException(BizExceptionCode.SALE_NULL_BILL);
+        }
         //检查转单状态
         String statuscode = sale.getSa_sendstatuscode();
         if (Status.TURNOUT.name().equals(statuscode)){
@@ -417,10 +423,9 @@ public class SaleServiceImpl implements SaleService{
         //插入验收单主表
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
-        //Object data = maxnumberService.getMaxnumber("Sale", true).getData();
-        Object data = "xxxxx" + (int)(Math.random()*100)+1;
-        JSONObject parse = (JSONObject)JSONObject.parse(data.toString());
-        String pi_inoutno = String.valueOf(parse.get("code"));
+        //String pi_inoutno = maxnumberService.getMaxnumber("Sale", true).getData();
+       // Object data =
+        String pi_inoutno = "xxxxx" + (int)(Math.random()*100)+1;;
 
         prodInOut.setPi_inoutno(pi_inoutno);
         prodInOut.setPi_class("出货单");

+ 1050 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -0,0 +1,1050 @@
+<?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.sale.mapper.ProdIODetailMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.entities.ProdIODetail">
+    <id column="pd_id" jdbcType="INTEGER" property="id" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="INTEGER" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="INTEGER" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <association property="product" javaType="com.usoftchina.saas.document.entities.Product">
+      <id column="pr_id" property="id"/>
+      <result column="pr_code" property="pr_code"/>
+      <result column="pr_detail" property="pr_detail"/>
+      <result column="pr_spec" property="pr_spec"/>
+      <result column="pr_unit" property="pr_unit"/>
+      <result column="pr_kind" property="pr_kind"/>
+      <result column="pr_orispeccode" property="pr_orispeccode"/>
+      <result column="pr_whid" property="pr_whid"/>
+      <result column="pr_whcode" property="pr_whcode"/>
+      <result column="pr_whname" property="pr_whname"/>
+      <result column="pr_zxbzs" property="pr_zxbzs"/>
+      <result column="pr_leadtime" property="pr_leadtime"/>
+      <result column="pr_brand" property="pr_brand"/>
+      <result column="pr_standardprice" property="pr_standardprice"/>
+      <result column="pr_purcprice" property="pr_purcprice"/>
+      <result column="pr_saleprice" property="pr_saleprice"/>
+      <result column="pr_vendid" property="pr_vendid"/>
+      <result column="pr_vendname" property="pr_vendname"/>
+      <result column="pr_vendcode" property="pr_vendcode"/>
+      <result column="pr_docdate" property="pr_docdate"/>
+      <result column="pr_recordmanid" property="pr_recordmanid"/>
+      <result column="pr_recordman" property="pr_recordman"/>
+      <result column="pr_status" property="pr_status"/>
+      <result column="pr_statuscode" property="pr_statuscode"/>
+      <result column="pr_text1" property="pr_text1"/>
+      <result column="pr_text2" property="pr_text2"/>
+      <result column="pr_text3" property="pr_text3"/>
+      <result column="pr_text4" property="pr_text4"/>
+    </association>
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.entities.ProdIODetail">
+    <result column="pd_remark" jdbcType="LONGVARCHAR" property="pd_remark" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    pd_id, pd_piid, pd_inoutno, pd_piclass, pd_pdno, pd_ordercode, pd_orderdetno, pd_prodid, 
+    pd_prodcode, pd_unit, pd_inqty, pd_outqty, pd_orderprice, pd_sendprice, pd_price, 
+    pd_total, pd_taxrate, pd_netprice, pd_nettotal, pd_whid, pd_whcode, pd_whname, pd_inwhid, 
+    pd_inwhcode, pd_inwhname, pd_orderid, pd_sdid, pd_status, companyid, updaterid, updatetime, 
+    pd_text1, pd_text2, pd_text3, pd_text4, pd_text5, pd_ym, pd_yqty,pd_ioid
+  </sql>
+  <sql id="Blob_Column_List">
+    pd_remark
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from prodiodetail
+    where pd_id = #{pd_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from prodiodetail
+    where pd_id = #{pd_id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    insert into prodiodetail (pd_id, pd_piid, pd_inoutno, 
+      pd_piclass, pd_pdno, pd_ordercode, 
+      pd_orderdetno, pd_prodid, pd_prodcode, 
+      pd_unit, pd_inqty, pd_outqty, 
+      pd_orderprice, pd_sendprice, pd_price, 
+      pd_total, pd_taxrate, pd_netprice, 
+      pd_nettotal, pd_whid, pd_whcode, 
+      pd_whname, pd_inwhid, pd_inwhcode, 
+      pd_inwhname, pd_orderid, pd_sdid, 
+      pd_status, companyid, updaterid, 
+      updatetime, pd_text1, pd_text2, 
+      pd_text3, pd_text4, pd_text5, 
+      pd_ym, pd_yqty, pd_remark,pd_ioid
+      )
+    values (#{pd_id,jdbcType=INTEGER}, #{pd_piid,jdbcType=INTEGER}, #{pd_inoutno,jdbcType=VARCHAR}, 
+      #{pd_piclass,jdbcType=VARCHAR}, #{pd_pdno,jdbcType=INTEGER}, #{pd_ordercode,jdbcType=VARCHAR}, 
+      #{pd_orderdetno,jdbcType=INTEGER}, #{pd_prodid,jdbcType=INTEGER}, #{pd_prodcode,jdbcType=VARCHAR}, 
+      #{pd_unit,jdbcType=VARCHAR}, #{pd_inqty,jdbcType=INTEGER}, #{pd_outqty,jdbcType=INTEGER}, 
+      #{pd_orderprice,jdbcType=DOUBLE}, #{pd_sendprice,jdbcType=DOUBLE}, #{pd_price,jdbcType=DOUBLE}, 
+      #{pd_total,jdbcType=DOUBLE}, #{pd_taxrate,jdbcType=DOUBLE}, #{pd_netprice,jdbcType=DOUBLE},
+      #{pd_nettotal,jdbcType=DOUBLE}, #{pd_whid,jdbcType=INTEGER}, #{pd_whcode,jdbcType=VARCHAR}, 
+      #{pd_whname,jdbcType=VARCHAR}, #{pd_inwhid,jdbcType=INTEGER}, #{pd_inwhcode,jdbcType=VARCHAR}, 
+      #{pd_inwhname,jdbcType=VARCHAR}, #{pd_orderid,jdbcType=INTEGER}, #{pd_sdid,jdbcType=INTEGER}, 
+      #{pd_status,jdbcType=INTEGER}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{updatetime,jdbcType=TIMESTAMP}, #{pd_text1,jdbcType=VARCHAR}, #{pd_text2,jdbcType=VARCHAR}, 
+      #{pd_text3,jdbcType=VARCHAR}, #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, 
+      #{pd_ym,jdbcType=INTEGER}, #{pd_yqty,jdbcType=INTEGER}, #{pd_remark,jdbcType=LONGVARCHAR},
+      #{pd_ioid,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into prodiodetail
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="pd_piid != null">
+        pd_piid,
+      </if>
+      <if test="pd_inoutno != null">
+        pd_inoutno,
+      </if>
+      <if test="pd_piclass != null">
+        pd_piclass,
+      </if>
+      <if test="pd_pdno != null">
+        pd_pdno,
+      </if>
+      <if test="pd_ordercode != null">
+        pd_ordercode,
+      </if>
+      <if test="pd_orderdetno != null">
+        pd_orderdetno,
+      </if>
+      <if test="pd_prodid != null">
+        pd_prodid,
+      </if>
+      <if test="pd_prodcode != null">
+        pd_prodcode,
+      </if>
+      <if test="pd_unit != null">
+        pd_unit,
+      </if>
+      <if test="pd_inqty != null">
+        pd_inqty,
+      </if>
+      <if test="pd_outqty != null">
+        pd_outqty,
+      </if>
+      <if test="pd_orderprice != null">
+        pd_orderprice,
+      </if>
+      <if test="pd_sendprice != null">
+        pd_sendprice,
+      </if>
+      <if test="pd_price != null">
+        pd_price,
+      </if>
+      <if test="pd_total != null">
+        pd_total,
+      </if>
+      <if test="pd_taxrate != null">
+        pd_taxrate,
+      </if>
+      <if test="pd_netprice != null">
+        pd_netprice,
+      </if>
+      <if test="pd_nettotal != null">
+        pd_nettotal,
+      </if>
+      <if test="pd_whid != null">
+        pd_whid,
+      </if>
+      <if test="pd_whcode != null">
+        pd_whcode,
+      </if>
+      <if test="pd_whname != null">
+        pd_whname,
+      </if>
+      <if test="pd_inwhid != null">
+        pd_inwhid,
+      </if>
+      <if test="pd_inwhcode != null">
+        pd_inwhcode,
+      </if>
+      <if test="pd_inwhname != null">
+        pd_inwhname,
+      </if>
+      <if test="pd_orderid != null">
+        pd_orderid,
+      </if>
+      <if test="pd_sdid != null">
+        pd_sdid,
+      </if>
+      <if test="pd_status != null">
+        pd_status,
+      </if>
+      <if test="companyId != null">
+        companyid,
+      </if>
+      <if test="updaterId != null">
+        updaterid,
+      </if>
+      <if test="updateTime != null">
+        updatetime,
+      </if>
+      <if test="pd_text1 != null">
+        pd_text1,
+      </if>
+      <if test="pd_text2 != null">
+        pd_text2,
+      </if>
+      <if test="pd_text3 != null">
+        pd_text3,
+      </if>
+      <if test="pd_text4 != null">
+        pd_text4,
+      </if>
+      <if test="pd_text5 != null">
+        pd_text5,
+      </if>
+      <if test="pd_ym != null">
+        pd_ym,
+      </if>
+      <if test="pd_yqty != null">
+        pd_yqty,
+      </if>
+      <if test="pd_remark != null">
+        pd_remark,
+      </if>
+      <if test="pd_ioid != null">
+        pd_ioid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="pd_piid != null">
+        #{pd_piid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_inoutno != null">
+        #{pd_inoutno,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_piclass != null">
+        #{pd_piclass,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_pdno != null">
+        #{pd_pdno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_ordercode != null">
+        #{pd_ordercode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_orderdetno != null">
+        #{pd_orderdetno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodid != null">
+        #{pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodcode != null">
+        #{pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_unit != null">
+        #{pd_unit,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inqty != null">
+        #{pd_inqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_outqty != null">
+        #{pd_outqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_orderprice != null">
+        #{pd_orderprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_sendprice != null">
+        #{pd_sendprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_price != null">
+        #{pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_total != null">
+        #{pd_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_taxrate != null">
+        #{pd_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_netprice != null">
+        #{pd_netprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_nettotal != null">
+        #{pd_nettotal,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_whid != null">
+        #{pd_whid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_whcode != null">
+        #{pd_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whname != null">
+        #{pd_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inwhid != null">
+        #{pd_inwhid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_inwhcode != null">
+        #{pd_inwhcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inwhname != null">
+        #{pd_inwhname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_orderid != null">
+        #{pd_orderid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_sdid != null">
+        #{pd_sdid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_status != null">
+        #{pd_status,jdbcType=INTEGER},
+      </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="pd_text1 != null">
+        #{pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text2 != null">
+        #{pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text3 != null">
+        #{pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text4 != null">
+        #{pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text5 != null">
+        #{pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_ym != null">
+        #{pd_ym,jdbcType=INTEGER},
+      </if>
+      <if test="pd_yqty != null">
+        #{pd_yqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_remark != null">
+        #{pd_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="pd_ioid != null">
+        #{pd_ioid,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodiodetail
+    <set>
+      <if test="pd_piid != null">
+        pd_piid = #{pd_piid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_inoutno != null">
+        pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_piclass != null">
+        pd_piclass = #{pd_piclass,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_pdno != null">
+        pd_pdno = #{pd_pdno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_ordercode != null">
+        pd_ordercode = #{pd_ordercode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_orderdetno != null">
+        pd_orderdetno = #{pd_orderdetno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodid != null">
+        pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodcode != null">
+        pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_unit != null">
+        pd_unit = #{pd_unit,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inqty != null">
+        pd_inqty = #{pd_inqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_outqty != null">
+        pd_outqty = #{pd_outqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_orderprice != null">
+        pd_orderprice = #{pd_orderprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_sendprice != null">
+        pd_sendprice = #{pd_sendprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_price != null">
+        pd_price = #{pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_total != null">
+        pd_total = #{pd_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_taxrate != null">
+        pd_taxrate = #{pd_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_netprice != null">
+        pd_netprice = #{pd_netprice,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_nettotal != null">
+        pd_nettotal = #{pd_nettotal,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_whid != null">
+        pd_whid = #{pd_whid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_whcode != null">
+        pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whname != null">
+        pd_whname = #{pd_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inwhid != null">
+        pd_inwhid = #{pd_inwhid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_inwhcode != null">
+        pd_inwhcode = #{pd_inwhcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_inwhname != null">
+        pd_inwhname = #{pd_inwhname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_orderid != null">
+        pd_orderid = #{pd_orderid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_sdid != null">
+        pd_sdid = #{pd_sdid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_status != null">
+        pd_status = #{pd_status,jdbcType=INTEGER},
+      </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="pd_text1 != null">
+        pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text2 != null">
+        pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text3 != null">
+        pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text4 != null">
+        pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text5 != null">
+        pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_ym != null">
+        pd_ym = #{pd_ym,jdbcType=INTEGER},
+      </if>
+      <if test="pd_yqty != null">
+        pd_yqty = #{pd_yqty,jdbcType=INTEGER},
+      </if>
+      <if test="pd_remark != null">
+        pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="pd_ioid != null">
+        pd_ioid = #{pd_ioid,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where pd_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodiodetail
+    set pd_piid = #{pd_piid,jdbcType=INTEGER},
+      pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
+      pd_piclass = #{pd_piclass,jdbcType=VARCHAR},
+      pd_pdno = #{pd_pdno,jdbcType=INTEGER},
+      pd_ordercode = #{pd_ordercode,jdbcType=VARCHAR},
+      pd_orderdetno = #{pd_orderdetno,jdbcType=INTEGER},
+      pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+      pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+      pd_unit = #{pd_unit,jdbcType=VARCHAR},
+      pd_inqty = #{pd_inqty,jdbcType=INTEGER},
+      pd_outqty = #{pd_outqty,jdbcType=INTEGER},
+      pd_orderprice = #{pd_orderprice,jdbcType=DOUBLE},
+      pd_sendprice = #{pd_sendprice,jdbcType=DOUBLE},
+      pd_price = #{pd_price,jdbcType=DOUBLE},
+      pd_total = #{pd_total,jdbcType=DOUBLE},
+      pd_taxrate = #{pd_taxrate,jdbcType=DOUBLE},
+      pd_netprice = #{pd_netprice,jdbcType=DOUBLE},
+      pd_nettotal = #{pd_nettotal,jdbcType=DOUBLE},
+      pd_whid = #{pd_whid,jdbcType=INTEGER},
+      pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+      pd_whname = #{pd_whname,jdbcType=VARCHAR},
+      pd_inwhid = #{pd_inwhid,jdbcType=INTEGER},
+      pd_inwhcode = #{pd_inwhcode,jdbcType=VARCHAR},
+      pd_inwhname = #{pd_inwhname,jdbcType=VARCHAR},
+      pd_orderid = #{pd_orderid,jdbcType=INTEGER},
+      pd_sdid = #{pd_sdid,jdbcType=INTEGER},
+      pd_status = #{pd_status,jdbcType=INTEGER},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterid = #{updaterid,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+      pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+      pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+      pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+      pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+      pd_ym = #{pd_ym,jdbcType=INTEGER},
+      pd_yqty = #{pd_yqty,jdbcType=INTEGER},
+      pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
+      pd_ioid = #{pd_ioid,jdbcType=INTEGER}
+    where pd_id = #{pd_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodiodetail
+    set pd_piid = #{pd_piid,jdbcType=INTEGER},
+      pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
+      pd_piclass = #{pd_piclass,jdbcType=VARCHAR},
+      pd_pdno = #{pd_pdno,jdbcType=INTEGER},
+      pd_ordercode = #{pd_ordercode,jdbcType=VARCHAR},
+      pd_orderdetno = #{pd_orderdetno,jdbcType=INTEGER},
+      pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+      pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+      pd_unit = #{pd_unit,jdbcType=VARCHAR},
+      pd_inqty = #{pd_inqty,jdbcType=INTEGER},
+      pd_outqty = #{pd_outqty,jdbcType=INTEGER},
+      pd_orderprice = #{pd_orderprice,jdbcType=DOUBLE},
+      pd_sendprice = #{pd_sendprice,jdbcType=DOUBLE},
+      pd_price = #{pd_price,jdbcType=DOUBLE},
+      pd_total = #{pd_total,jdbcType=DOUBLE},
+      pd_taxrate = #{pd_taxrate,jdbcType=DOUBLE},
+      pd_netprice = #{pd_netprice,jdbcType=DOUBLE},
+      pd_nettotal = #{pd_nettotal,jdbcType=DOUBLE},
+      pd_whid = #{pd_whid,jdbcType=INTEGER},
+      pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+      pd_whname = #{pd_whname,jdbcType=VARCHAR},
+      pd_inwhid = #{pd_inwhid,jdbcType=INTEGER},
+      pd_inwhcode = #{pd_inwhcode,jdbcType=VARCHAR},
+      pd_inwhname = #{pd_inwhname,jdbcType=VARCHAR},
+      pd_orderid = #{pd_orderid,jdbcType=INTEGER},
+      pd_sdid = #{pd_sdid,jdbcType=INTEGER},
+      pd_status = #{pd_status,jdbcType=INTEGER},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterid = #{updaterid,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+      pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+      pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+      pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+      pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+      pd_ym = #{pd_ym,jdbcType=INTEGER},
+      pd_yqty = #{pd_yqty,jdbcType=INTEGER},
+      pd_ioid = #{pd_ioid,jdbcType=INTEGER}
+    where pd_id = #{pd_id,jdbcType=INTEGER}
+  </update>
+
+  <insert id="batchInsert" parameterType="java.util.List" >
+    insert into prodiodetail
+    (
+    pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_ordercode,
+    pd_orderdetno,pd_prodid,pd_prodcode,pd_unit,
+    pd_inqty,pd_outqty,pd_orderprice,pd_sendprice,pd_price,
+    pd_total,pd_taxrate,pd_netprice,pd_nettotal,
+    pd_whid,pd_whcode,pd_whname,pd_inwhid,pd_inwhcode,
+    pd_inwhname,pd_orderid,pd_sdid,pd_status,pd_remark,
+    companyid,updaterid,updatetime,pd_text1,pd_text2,
+    pd_text3,pd_text4,pd_text5,pd_ym,pd_yqty
+    )
+    values
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      (
+      #{item.pd_piid,jdbcType=INTEGER},#{item.pd_inoutno,jdbcType=VARCHAR},#{item.pd_piclass,jdbcType=VARCHAR},#{item.pd_pdno,jdbcType=INTEGER},#{item.pd_ordercode,jdbcType=VARCHAR},
+      #{item.pd_orderdetno,jdbcType=INTEGER},#{item.pd_prodid,jdbcType=INTEGER},#{item.pd_prodcode,jdbcType=VARCHAR},#{item.pd_unit,jdbcType=VARCHAR},
+      #{item.pd_inqty,jdbcType=INTEGER},#{item.pd_outqty,jdbcType=INTEGER},#{item.pd_orderprice,jdbcType=DOUBLE},#{item.pd_sendprice,jdbcType=DOUBLE},#{item.pd_price,jdbcType=DOUBLE},
+      #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE},#{item.pd_netprice,jdbcType=DOUBLE},#{item.pd_nettotal,jdbcType=DOUBLE},
+      #{item.pd_whid,jdbcType=INTEGER},#{item.pd_whcode,jdbcType=VARCHAR},#{item.pd_whname,jdbcType=VARCHAR},#{item.pd_inwhid,jdbcType=INTEGER},#{item.pd_inwhcode,jdbcType=VARCHAR},
+      #{item.pd_inwhname,jdbcType=VARCHAR},#{item.pd_orderid,jdbcType=INTEGER},#{item.pd_sdid,jdbcType=INTEGER},#{item.pd_status,jdbcType=VARCHAR},#{item.pd_remark,jdbcType=VARCHAR},
+      #{item.companyId,jdbcType=INTEGER},#{item.updaterId,jdbcType=INTEGER},#{item.updateTime,jdbcType=TIMESTAMP},#{item.pd_text1,jdbcType=VARCHAR},#{item.pd_text2,jdbcType=VARCHAR},
+      #{item.pd_text3,jdbcType=VARCHAR},#{item.pd_text4,jdbcType=VARCHAR},#{item.pd_text5,jdbcType=VARCHAR},#{item.pd_ym,jdbcType=INTEGER},#{item.pd_yqty,jdbcType=INTEGER}
+      )
+    </foreach>
+  </insert>
+
+  <insert id="batchInsert1" parameterType="java.util.List" >
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      insert into prodiodetail
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.pd_piid != null">
+          pd_piid,
+        </if>
+        <if test="item.pd_inoutno != null">
+          pd_inoutno,
+        </if>
+        <if test="item.pd_piclass != null">
+          pd_piclass,
+        </if>
+        <if test="item.pd_pdno != null">
+          pd_pdno,
+        </if>
+        <if test="item.pd_ordercode != null">
+          pd_ordercode,
+        </if>
+        <if test="item.pd_orderdetno != null">
+          pd_orderdetno,
+        </if>
+        <if test="item.pd_prodid != null">
+          pd_prodid,
+        </if>
+        <if test="item.pd_prodcode != null">
+          pd_prodcode,
+        </if>
+        <if test="item.pd_unit != null">
+          pd_unit,
+        </if>
+        <if test="item.pd_inqty != null">
+          pd_inqty,
+        </if>
+        <if test="item.pd_outqty != null">
+          pd_outqty,
+        </if>
+        <if test="item.pd_orderprice != null">
+          pd_orderprice,
+        </if>
+        <if test="item.pd_sendprice != null">
+          pd_sendprice,
+        </if>
+        <if test="item.pd_price != null">
+          pd_price,
+        </if>
+        <if test="item.pd_total != null">
+          pd_total,
+        </if>
+        <if test="item.pd_taxrate != null">
+          pd_taxrate,
+        </if>
+        <if test="item.pd_netprice != null">
+          pd_netprice,
+        </if>
+        <if test="item.pd_nettotal != null">
+          pd_nettotal,
+        </if>
+        <if test="item.pd_whid != null">
+          pd_whid,
+        </if>
+        <if test="item.pd_whcode != null">
+          pd_whcode,
+        </if>
+        <if test="item.pd_whname != null">
+          pd_whname,
+        </if>
+        <if test="item.pd_inwhid != null">
+          pd_inwhid,
+        </if>
+        <if test="item.pd_inwhcode != null">
+          pd_inwhcode,
+        </if>
+        <if test="item.pd_inwhname != null">
+          pd_inwhname,
+        </if>
+        <if test="item.pd_orderid != null">
+          pd_orderid,
+        </if>
+        <if test="item.pd_sdid != null">
+          pd_sdid,
+        </if>
+        <if test="item.pd_status != null">
+          pd_status,
+        </if>
+        <if test="item.companyId != null">
+          companyid,
+        </if>
+        <if test="item.updaterId != null">
+          updaterid,
+        </if>
+        <if test="item.updateTime != null">
+          updatetime,
+        </if>
+        <if test="item.pd_text1 != null">
+          pd_text1,
+        </if>
+        <if test="item.pd_text2 != null">
+          pd_text2,
+        </if>
+        <if test="item.pd_text3 != null">
+          pd_text3,
+        </if>
+        <if test="item.pd_text4 != null">
+          pd_text4,
+        </if>
+        <if test="item.pd_text5 != null">
+          pd_text5,
+        </if>
+        <if test="item.pd_ym != null">
+          pd_ym,
+        </if>
+        <if test="item.pd_yqty != null">
+          pd_yqty,
+        </if>
+        <if test="item.pd_remark != null">
+          pd_remark,
+        </if>
+        <if test="item.pd_ioid != null">
+          pd_ioid,
+        </if>
+      </trim>
+      <trim prefix="values (" suffix=")" suffixOverrides=",">
+        <if test="item.pd_piid != null">
+          #{item.pd_piid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_inoutno != null">
+          #{item.pd_inoutno,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_piclass != null">
+          #{item.pd_piclass,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_pdno != null">
+          #{item.pd_pdno,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_ordercode != null">
+          #{item.pd_ordercode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_orderdetno != null">
+          #{item.pd_orderdetno,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_prodid != null">
+          #{item.pd_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_prodcode != null">
+          #{item.pd_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_unit != null">
+          #{item.pd_unit,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inqty != null">
+          #{item.pd_inqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_outqty != null">
+          #{item.pd_outqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_orderprice != null">
+          #{item.pd_orderprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_sendprice != null">
+          #{item.pd_sendprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_price != null">
+          #{item.pd_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_total != null">
+          #{item.pd_total,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_taxrate != null">
+          #{item.pd_taxrate,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_netprice != null">
+          #{item.pd_netprice,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_nettotal != null">
+          #{item.pd_nettotal,jdbcType=DOUBLE},
+        </if>
+        <if test="item.pd_whid != null">
+          #{item.pd_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_whcode != null">
+          #{item.pd_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_whname != null">
+          #{item.pd_whname,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inwhid != null">
+          #{item.pd_inwhid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_inwhcode != null">
+          #{item.pd_inwhcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_inwhname != null">
+          #{item.pd_inwhname,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_orderid != null">
+          #{item.pd_orderid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_sdid != null">
+          #{item.pd_sdid,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_status != null">
+          #{item.pd_status,jdbcType=INTEGER},
+        </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>
+        <if test="item.pd_text1 != null">
+          #{item.pd_text1,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text2 != null">
+          #{item.pd_text2,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text3 != null">
+          #{item.pd_text3,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text4 != null">
+          #{item.pd_text4,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_text5 != null">
+          #{item.pd_text5,jdbcType=VARCHAR},
+        </if>
+        <if test="item.pd_ym != null">
+          #{item.pd_ym,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_yqty != null">
+          #{item.pd_yqty,jdbcType=INTEGER},
+        </if>
+        <if test="item.pd_remark != null">
+          #{item.pd_remark,jdbcType=LONGVARCHAR},
+        </if>
+        <if test="item.pd_ioid != null">
+          #{item.pd_ioid,jdbcType=INTEGER},
+        </if>
+      </trim>
+
+    </foreach>
+  </insert>
+
+
+
+
+
+
+
+
+
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.entities.ProdInOut" >
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update prodiodetail <set>
+      <if test="item.pd_piid !=null">
+        pd_piid = #{item.pd_piid},
+      </if>
+      <if test="item.pd_inoutno !=null">
+        pd_inoutno = #{item.pd_inoutno},
+      </if>
+      <if test="item.pd_piclass !=null">
+        pd_piclass = #{item.pd_piclass},
+      </if>
+      <if test="item.pd_pdno !=null">
+        pd_pdno = #{item.pd_pdno},
+      </if>
+      <if test="item.pd_ordercode !=null">
+        pd_ordercode = #{item.pd_ordercode},
+      </if>
+      <if test="item.pd_orderdetno !=null">
+        pd_orderdetno = #{item.pd_orderdetno},
+      </if>
+      <if test="item.pd_prodid !=null">
+        pd_prodid = #{item.pd_prodid},
+      </if>
+      <if test="item.pd_prodcode !=null">
+        pd_prodcode = #{item.pd_prodcode},
+      </if>
+      <if test="item.pd_unit !=null">
+        pd_unit = #{item.pd_unit},
+      </if>
+      <if test="item.pd_inqty !=null">
+        pd_inqty = #{item.pd_inqty},
+      </if>
+      <if test="item.pd_outqty !=null">
+        pd_outqty = #{item.pd_outqty},
+      </if>
+      <if test="item.pd_orderprice !=null">
+        pd_orderprice = #{item.pd_orderprice},
+      </if>
+      <if test="item.pd_sendprice !=null">
+        pd_sendprice = #{item.pd_sendprice},
+      </if>
+      <if test="item.pd_price !=null">
+        pd_price = #{item.pd_price},
+      </if>
+      <if test="item.pd_total !=null">
+        pd_total = #{item.pd_total},
+      </if>
+      <if test="item.pd_taxrate !=null">
+        pd_taxrate = #{item.pd_taxrate},
+      </if>
+      <if test="item.pd_netprice !=null">
+        pd_netprice = #{item.pd_netprice},
+      </if>
+      <if test="item.pd_nettotal !=null">
+        pd_nettotal = #{item.pd_nettotal},
+      </if>
+      <if test="item.pd_whid !=null">
+        pd_whid = #{item.pd_whid},
+      </if>
+      <if test="item.pd_whcode !=null">
+        pd_whcode = #{item.pd_whcode},
+      </if>
+      <if test="item.pd_whname !=null">
+        pd_whname = #{item.pd_whname},
+      </if>
+      <if test="item.pd_inwhid !=null">
+        pd_inwhid = #{item.pd_inwhid},
+      </if>
+      <if test="item.pd_inwhcode !=null">
+        pd_inwhcode = #{item.pd_inwhcode},
+      </if>
+      <if test="item.pd_inwhname !=null">
+        pd_inwhname = #{item.pd_inwhname},
+      </if>
+      <if test="item.pd_orderid !=null">
+        pd_orderid = #{item.pd_orderid},
+      </if>
+      <if test="item.pd_sdid !=null">
+        pd_sdid = #{item.pd_sdid},
+      </if>
+      <if test="item.pd_status !=null">
+        pd_status = #{item.pd_status},
+      </if>
+      <if test="item.pd_remark !=null">
+        pd_remark = #{item.pd_remark},
+      </if>
+      <if test="item.companyId!=null">
+        companyId = #{item.companyId},
+      </if>
+      <if test="item.updaterId!=null">
+        updaterId = #{item.updaterId},
+      </if>
+      <if test="item.updateTime!=null">
+        updateTime = #{item.updateTime},
+      </if>
+      pd_text1 = #{item.pd_text1},
+      pd_text2 = #{item.pd_text2},
+      pd_text3 = #{item.pd_text3},
+      pd_text4 = #{item.pd_text4},
+      pd_text5 = #{item.pd_text5},
+      <if test="item.pd_ym!=null">
+        pd_ym = #{item.pd_ym},
+      </if>
+      <if test="item.pd_yqty!=null">
+        pd_yqty = #{item.pd_yqty},
+      </if>
+    </set>
+      where PD_ID = #{item.id,jdbcType=INTEGER}
+    </foreach>
+  </update>
+
+  <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
+
+update prodiodetail a
+set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_ioid,sum(pd_outqty) pd_outqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
+and pi_puid=#{id,jdbcType=INTEGER}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
+  </update>
+
+
+  <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
+    select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
+    where pd_piid=#{id} order by pd_pdno
+  </select>
+
+
+
+</mapper>

+ 500 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -0,0 +1,500 @@
+<?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.sale.mapper.ProdInOutMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.entities.ProdInOut">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
+    <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
+    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="pi_recorddate" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="companyid" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.entities.ProdInOut">
+    <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
+    pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
+    pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+  </sql>
+  <sql id="Blob_Column_List">
+    pi_address
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from prodinout
+    where pi_id = #{pi_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from prodinout
+    where pi_id = #{pi_id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    insert into prodinout (pi_id, pi_inoutno, pi_class, 
+      pi_date, pi_vendid, pi_vendcode, 
+      pi_vendname, pi_custid, pi_custcode, 
+      pi_custname, pi_puid, pi_pucode, 
+      pi_said, pi_sacode, pi_total, 
+      pi_recordmanid, pi_recordman, pi_recorddate, 
+      pi_status, pi_statuscode, pi_printstatus, 
+      pi_printstatuscode, companyid, updaterid, 
+      updatetime, pi_text1, pi_text2, 
+      pi_text3, pi_text4, pi_text5,
+      pi_address)
+    values (#{pi_id,jdbcType=INTEGER}, #{pi_inoutno,jdbcType=VARCHAR}, #{pi_class,jdbcType=VARCHAR}, 
+      #{pi_date,jdbcType=TIMESTAMP}, #{pi_vendid,jdbcType=INTEGER}, #{pi_vendcode,jdbcType=VARCHAR}, 
+      #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
+      #{pi_custname,jdbcType=VARCHAR}, #{pi_puid,jdbcType=INTEGER}, #{pi_pucode,jdbcType=VARCHAR}, 
+      #{pi_said,jdbcType=INTEGER}, #{pi_sacode,jdbcType=VARCHAR}, #{pi_total,jdbcType=DOUBLE},
+      #{pi_recordmanid,jdbcType=INTEGER}, #{pi_recordman,jdbcType=VARCHAR}, #{pi_recorddate,jdbcType=TIMESTAMP}, 
+      #{pi_status,jdbcType=VARCHAR}, #{pi_statuscode,jdbcType=VARCHAR}, #{pi_printstatus,jdbcType=VARCHAR}, 
+      #{pi_printstatuscode,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
+      #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
+      #{pi_address,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into prodinout
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+
+      <if test="pi_inoutno != null">
+        pi_inoutno,
+      </if>
+      <if test="pi_class != null">
+        pi_class,
+      </if>
+      <if test="pi_date != null">
+        pi_date,
+      </if>
+      <if test="pi_vendid != null">
+        pi_vendid,
+      </if>
+      <if test="pi_vendcode != null">
+        pi_vendcode,
+      </if>
+      <if test="pi_vendname != null">
+        pi_vendname,
+      </if>
+      <if test="pi_custid != null">
+        pi_custid,
+      </if>
+      <if test="pi_custcode != null">
+        pi_custcode,
+      </if>
+      <if test="pi_custname != null">
+        pi_custname,
+      </if>
+      <if test="pi_puid != null">
+        pi_puid,
+      </if>
+      <if test="pi_pucode != null">
+        pi_pucode,
+      </if>
+      <if test="pi_said != null">
+        pi_said,
+      </if>
+      <if test="pi_sacode != null">
+        pi_sacode,
+      </if>
+      <if test="pi_total != null">
+        pi_total,
+      </if>
+      <if test="pi_recordmanid != null">
+        pi_recordmanid,
+      </if>
+      <if test="pi_recordman != null">
+        pi_recordman,
+      </if>
+      <if test="pi_recorddate != null">
+        pi_recorddate,
+      </if>
+      <if test="pi_status != null">
+        pi_status,
+      </if>
+      <if test="pi_statuscode != null">
+        pi_statuscode,
+      </if>
+      <if test="pi_printstatus != null">
+        pi_printstatus,
+      </if>
+      <if test="pi_printstatuscode != null">
+        pi_printstatuscode,
+      </if>
+      <if test="companyId != null">
+        companyid,
+      </if>
+      <if test="updaterId != null">
+        updaterid,
+      </if>
+      <if test="updateTime != null">
+        updatetime,
+      </if>
+      <if test="pi_text1 != null">
+        pi_text1,
+      </if>
+      <if test="pi_text2 != null">
+        pi_text2,
+      </if>
+      <if test="pi_text3 != null">
+        pi_text3,
+      </if>
+      <if test="pi_text4 != null">
+        pi_text4,
+      </if>
+      <if test="pi_text5 != null">
+        pi_text5,
+      </if>
+      <if test="pi_address != null">
+        pi_address,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+      <if test="pi_inoutno != null">
+        #{pi_inoutno,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_class != null">
+        #{pi_class,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_date != null">
+        #{pi_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_vendid != null">
+        #{pi_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_vendcode != null">
+        #{pi_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_vendname != null">
+        #{pi_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_custid != null">
+        #{pi_custid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_custcode != null">
+        #{pi_custcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_custname != null">
+        #{pi_custname,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_puid != null">
+        #{pi_puid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_pucode != null">
+        #{pi_pucode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_said != null">
+        #{pi_said,jdbcType=INTEGER},
+      </if>
+      <if test="pi_sacode != null">
+        #{pi_sacode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_total != null">
+        #{pi_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pi_recordmanid != null">
+        #{pi_recordmanid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_recordman != null">
+        #{pi_recordman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_recorddate != null">
+        #{pi_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_status != null">
+        #{pi_status,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_statuscode != null">
+        #{pi_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_printstatus != null">
+        #{pi_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_printstatuscode != null">
+        #{pi_printstatuscode,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>
+      <if test="pi_text1 != null">
+        #{pi_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text2 != null">
+        #{pi_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text3 != null">
+        #{pi_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text4 != null">
+        #{pi_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text5 != null">
+        #{pi_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_address != null">
+        #{pi_address,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodinout
+    <set>
+      <if test="pi_inoutno != null">
+        pi_inoutno = #{pi_inoutno,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_class != null">
+        pi_class = #{pi_class,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_date != null">
+        pi_date = #{pi_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_vendid != null">
+        pi_vendid = #{pi_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_vendcode != null">
+        pi_vendcode = #{pi_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_vendname != null">
+        pi_vendname = #{pi_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_custid != null">
+        pi_custid = #{pi_custid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_custcode != null">
+        pi_custcode = #{pi_custcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_custname != null">
+        pi_custname = #{pi_custname,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_puid != null">
+        pi_puid = #{pi_puid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_pucode != null">
+        pi_pucode = #{pi_pucode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_said != null">
+        pi_said = #{pi_said,jdbcType=INTEGER},
+      </if>
+      <if test="pi_sacode != null">
+        pi_sacode = #{pi_sacode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_total != null">
+        pi_total = #{pi_total,jdbcType=DOUBLE},
+      </if>
+      <if test="pi_recordmanid != null">
+        pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
+      </if>
+      <if test="pi_recordman != null">
+        pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_recorddate != null">
+        pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_status != null">
+        pi_status = #{pi_status,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_statuscode != null">
+        pi_statuscode = #{pi_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_printstatus != null">
+        pi_printstatus = #{pi_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_printstatuscode != null">
+        pi_printstatuscode = #{pi_printstatuscode,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>
+      <if test="pi_text1 != null">
+        pi_text1 = #{pi_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text2 != null">
+        pi_text2 = #{pi_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text3 != null">
+        pi_text3 = #{pi_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text4 != null">
+        pi_text4 = #{pi_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_text5 != null">
+        pi_text5 = #{pi_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_address != null">
+        pi_address = #{pi_address,jdbcType=LONGVARCHAR},
+      </if>
+
+    </set>
+    where pi_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodinout
+    set pi_inoutno = #{pi_inoutno,jdbcType=VARCHAR},
+      pi_class = #{pi_class,jdbcType=VARCHAR},
+      pi_date = #{pi_date,jdbcType=TIMESTAMP},
+      pi_vendid = #{pi_vendid,jdbcType=INTEGER},
+      pi_vendcode = #{pi_vendcode,jdbcType=VARCHAR},
+      pi_vendname = #{pi_vendname,jdbcType=VARCHAR},
+      pi_custid = #{pi_custid,jdbcType=INTEGER},
+      pi_custcode = #{pi_custcode,jdbcType=VARCHAR},
+      pi_custname = #{pi_custname,jdbcType=VARCHAR},
+      pi_puid = #{pi_puid,jdbcType=INTEGER},
+      pi_pucode = #{pi_pucode,jdbcType=VARCHAR},
+      pi_said = #{pi_said,jdbcType=INTEGER},
+      pi_sacode = #{pi_sacode,jdbcType=VARCHAR},
+      pi_total = #{pi_total,jdbcType=DOUBLE},
+      pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
+      pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
+      pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
+      pi_status = #{pi_status,jdbcType=VARCHAR},
+      pi_statuscode = #{pi_statuscode,jdbcType=VARCHAR},
+      pi_printstatus = #{pi_printstatus,jdbcType=VARCHAR},
+      pi_printstatuscode = #{pi_printstatuscode,jdbcType=VARCHAR},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterid = #{updaterid,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      pi_text1 = #{pi_text1,jdbcType=VARCHAR},
+      pi_text2 = #{pi_text2,jdbcType=VARCHAR},
+      pi_text3 = #{pi_text3,jdbcType=VARCHAR},
+      pi_text4 = #{pi_text4,jdbcType=VARCHAR},
+      pi_text5 = #{pi_text5,jdbcType=VARCHAR},
+      pi_address = #{pi_address,jdbcType=LONGVARCHAR}
+
+    where pi_id = #{pi_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.entities.ProdInOut">
+    update prodinout
+    set pi_inoutno = #{pi_inoutno,jdbcType=VARCHAR},
+      pi_class = #{pi_class,jdbcType=VARCHAR},
+      pi_date = #{pi_date,jdbcType=TIMESTAMP},
+      pi_vendid = #{pi_vendid,jdbcType=INTEGER},
+      pi_vendcode = #{pi_vendcode,jdbcType=VARCHAR},
+      pi_vendname = #{pi_vendname,jdbcType=VARCHAR},
+      pi_custid = #{pi_custid,jdbcType=INTEGER},
+      pi_custcode = #{pi_custcode,jdbcType=VARCHAR},
+      pi_custname = #{pi_custname,jdbcType=VARCHAR},
+      pi_puid = #{pi_puid,jdbcType=INTEGER},
+      pi_pucode = #{pi_pucode,jdbcType=VARCHAR},
+      pi_said = #{pi_said,jdbcType=INTEGER},
+      pi_sacode = #{pi_sacode,jdbcType=VARCHAR},
+      pi_total = #{pi_total,jdbcType=DOUBLE},
+      pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
+      pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
+      pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
+      pi_status = #{pi_status,jdbcType=VARCHAR},
+      pi_statuscode = #{pi_statuscode,jdbcType=VARCHAR},
+      pi_printstatus = #{pi_printstatus,jdbcType=VARCHAR},
+      pi_printstatuscode = #{pi_printstatuscode,jdbcType=VARCHAR},
+      companyid = #{companyId,jdbcType=INTEGER},
+      updaterid = #{updaterId,jdbcType=INTEGER},
+      updatetime = #{updateTime,jdbcType=TIMESTAMP},
+      pi_text1 = #{pi_text1,jdbcType=VARCHAR},
+      pi_text2 = #{pi_text2,jdbcType=VARCHAR},
+      pi_text3 = #{pi_text3,jdbcType=VARCHAR},
+      pi_text4 = #{pi_text4,jdbcType=VARCHAR},
+      pi_text5 = #{pi_text5,jdbcType=VARCHAR}
+    where pi_id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 15 - 21
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -22,7 +22,7 @@
     <result column="sa_recorddate" property="sa_recorddate" jdbcType="TIMESTAMP" />
     <result column="companyid" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
-    <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="sa_text1" property="sa_text1" jdbcType="VARCHAR" />
     <result column="sa_text2" property="sa_text2" jdbcType="VARCHAR" />
     <result column="sa_text3" property="sa_text3" jdbcType="VARCHAR" />
@@ -33,7 +33,7 @@
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyid, updaterId, 
-    updatetime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5
+    updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -41,9 +41,9 @@
     from sale
     where sa_id = #{id}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="long" >
     delete from sale
-    where sa_id = #{sa_id,jdbcType=INTEGER}
+    where sa_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.sale.po.Sale" >
     insert into sale (sa_id, sa_code, sa_custid, 
@@ -52,7 +52,7 @@
       sa_status, sa_statuscode, sa_sendstatuscode, 
       sa_sendstatus, sa_printstatus, sa_printstatuscode, 
       sa_recorderid, sa_recorder, sa_recorddate, 
-      companyid, updaterId, updatetime, 
+      companyid, updaterId, updateTime, 
       sa_text1, sa_text2, sa_text3, 
       sa_text4, sa_text5)
     values (#{sa_id,jdbcType=INTEGER}, #{sa_code,jdbcType=VARCHAR}, #{sa_custid,jdbcType=INTEGER}, 
@@ -61,16 +61,13 @@
       #{sa_status,jdbcType=VARCHAR}, #{sa_statuscode,jdbcType=VARCHAR}, #{sa_sendstatuscode,jdbcType=VARCHAR}, 
       #{sa_sendstatus,jdbcType=VARCHAR}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
       #{sa_recorderid,jdbcType=INTEGER}, #{sa_recorder,jdbcType=VARCHAR}, #{sa_recorddate,jdbcType=TIMESTAMP}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP}, 
+      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{sa_text1,jdbcType=VARCHAR}, #{sa_text2,jdbcType=VARCHAR}, #{sa_text3,jdbcType=VARCHAR}, 
       #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
     insert into sale
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="sa_id != null" >
-        sa_id,
-      </if>
       <if test="sa_code != null" >
         sa_code,
       </if>
@@ -128,8 +125,8 @@
       <if test="updaterId != null" >
         updaterId,
       </if>
-      <if test="updatetime != null" >
-        updatetime,
+      <if test="updateTime != null" >
+        updateTime,
       </if>
       <if test="sa_text1 != null" >
         sa_text1,
@@ -148,9 +145,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="sa_id != null" >
-        #{sa_id,jdbcType=INTEGER},
-      </if>
       <if test="sa_code != null" >
         #{sa_code,jdbcType=VARCHAR},
       </if>
@@ -208,8 +202,8 @@
       <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="sa_text1 != null" >
         #{sa_text1,jdbcType=VARCHAR},
@@ -288,8 +282,8 @@
       <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="sa_text1 != null" >
         sa_text1 = #{sa_text1,jdbcType=VARCHAR},
@@ -307,7 +301,7 @@
         sa_text5 = #{sa_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where sa_id = #{sa_id,jdbcType=INTEGER}
+    where sa_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.sale.po.Sale" >
     update sale
@@ -330,13 +324,13 @@
       sa_recorddate = #{sa_recorddate,jdbcType=TIMESTAMP},
       companyid = #{companyid,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
-      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
       sa_text1 = #{sa_text1,jdbcType=VARCHAR},
       sa_text2 = #{sa_text2,jdbcType=VARCHAR},
       sa_text3 = #{sa_text3,jdbcType=VARCHAR},
       sa_text4 = #{sa_text4,jdbcType=VARCHAR},
       sa_text5 = #{sa_text5,jdbcType=VARCHAR}
-    where sa_id = #{sa_id,jdbcType=INTEGER}
+    where sa_id = #{id,jdbcType=INTEGER}
   </update>
 
   <select id="validateCodeWhenInsert" resultType="int" parameterType="string" >

+ 32 - 32
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -17,9 +17,9 @@
     <result column="sd_sendqty" property="sd_sendqty" jdbcType="DOUBLE" />
     <result column="sd_pdqty" property="sd_pdqty" jdbcType="DOUBLE" />
     <result column="sd_remark" property="sd_remark" jdbcType="VARCHAR" />
-    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
-    <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="sd_text1" property="sd_text1" jdbcType="VARCHAR" />
     <result column="sd_text2" property="sd_text2" jdbcType="VARCHAR" />
     <result column="sd_text3" property="sd_text3" jdbcType="VARCHAR" />
@@ -28,18 +28,18 @@
   </resultMap>
   <sql id="Base_Column_List" >
     sd_id, sd_said, sd_detno, sd_prodid, sd_prodcode, sd_qty, sd_price, sd_total, sd_taxrate, 
-    sd_netprice, sd_nettotal, sd_delivery, sd_sendqty, sd_pdqty, sd_remark, companyid, 
-    updaterId, updatetime, sd_text1, sd_text2, sd_text3, sd_text4, sd_text5
+    sd_netprice, sd_nettotal, sd_delivery, sd_sendqty, sd_pdqty, sd_remark, companyId, 
+    updaterId, updateTime, sd_text1, sd_text2, sd_text3, sd_text4, sd_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
     from saledetail
-    where sd_id = #{sd_id,jdbcType=INTEGER}
+    where sd_id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from saledetail
-    where sd_id = #{sd_id}
+    where sd_id = #{id}
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.sale.po.SaleDetail" >
@@ -48,22 +48,22 @@
       sd_price, sd_total, sd_taxrate, 
       sd_netprice, sd_nettotal, sd_delivery, 
       sd_sendqty, sd_pdqty, sd_remark, 
-      companyid, updaterId, updatetime, 
+      companyId, updaterId, updateTime, 
       sd_text1, sd_text2, sd_text3, 
       sd_text4, sd_text5)
-    values (#{sd_id,jdbcType=INTEGER}, #{sd_said,jdbcType=INTEGER}, #{sd_detno,jdbcType=INTEGER}, 
+    values (#{id,jdbcType=INTEGER}, #{sd_said,jdbcType=INTEGER}, #{sd_detno,jdbcType=INTEGER},
       #{sd_prodid,jdbcType=INTEGER}, #{sd_prodcode,jdbcType=VARCHAR}, #{sd_qty,jdbcType=DOUBLE}, 
       #{sd_price,jdbcType=DOUBLE}, #{sd_total,jdbcType=DOUBLE}, #{sd_taxrate,jdbcType=DOUBLE}, 
       #{sd_netprice,jdbcType=DOUBLE}, #{sd_nettotal,jdbcType=DOUBLE}, #{sd_delivery,jdbcType=TIMESTAMP}, 
       #{sd_sendqty,jdbcType=DOUBLE}, #{sd_pdqty,jdbcType=DOUBLE}, #{sd_remark,jdbcType=VARCHAR}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP}, 
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{sd_text1,jdbcType=VARCHAR}, #{sd_text2,jdbcType=VARCHAR}, #{sd_text3,jdbcType=VARCHAR}, 
       #{sd_text4,jdbcType=VARCHAR}, #{sd_text5,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.SaleDetail" >
     insert into saledetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="sd_id != null" >
+      <if test="id != null" >
         sd_id,
       </if>
       <if test="sd_said != null" >
@@ -108,14 +108,14 @@
       <if test="sd_remark != null" >
         sd_remark,
       </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="sd_text1 != null" >
         sd_text1,
@@ -134,8 +134,8 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="sd_id != null" >
-        #{sd_id,jdbcType=INTEGER},
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
       </if>
       <if test="sd_said != null" >
         #{sd_said,jdbcType=INTEGER},
@@ -179,14 +179,14 @@
       <if test="sd_remark != null" >
         #{sd_remark,jdbcType=VARCHAR},
       </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="sd_text1 != null" >
         #{sd_text1,jdbcType=VARCHAR},
@@ -250,14 +250,14 @@
       <if test="sd_remark != null" >
         sd_remark = #{sd_remark,jdbcType=VARCHAR},
       </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="sd_text1 != null" >
         sd_text1 = #{sd_text1,jdbcType=VARCHAR},
@@ -275,7 +275,7 @@
         sd_text5 = #{sd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where sd_id = #{sd_id,jdbcType=INTEGER}
+    where sd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.sale.po.SaleDetail" >
     update saledetail
@@ -293,15 +293,15 @@
       sd_sendqty = #{sd_sendqty,jdbcType=DOUBLE},
       sd_pdqty = #{sd_pdqty,jdbcType=DOUBLE},
       sd_remark = #{sd_remark,jdbcType=VARCHAR},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
-      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
       sd_text1 = #{sd_text1,jdbcType=VARCHAR},
       sd_text2 = #{sd_text2,jdbcType=VARCHAR},
       sd_text3 = #{sd_text3,jdbcType=VARCHAR},
       sd_text4 = #{sd_text4,jdbcType=VARCHAR},
       sd_text5 = #{sd_text5,jdbcType=VARCHAR}
-    where sd_id = #{sd_id,jdbcType=INTEGER}
+    where sd_id = #{id,jdbcType=INTEGER}
   </update>
 
   <insert id="batchInsert" parameterType="java.util.List" >
@@ -310,7 +310,7 @@
     sd_price, sd_total, sd_taxrate,
     sd_netprice, sd_nettotal, sd_delivery,
     sd_sendqty, sd_pdqty, sd_remark,
-    companyid, updaterId, updatetime,
+    companyId, updaterId, updateTime,
     sd_text1, sd_text2, sd_text3,
     sd_text4, sd_text5)
     values
@@ -321,7 +321,7 @@
       #{item.sd_price,jdbcType=DOUBLE}, #{item.sd_total,jdbcType=DOUBLE}, #{item.sd_taxrate,jdbcType=DOUBLE},
       #{item.sd_netprice,jdbcType=DOUBLE}, #{item.sd_nettotal,jdbcType=DOUBLE}, #{item.sd_delivery,jdbcType=TIMESTAMP},
       #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
-      #{item.companyid,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updatetime,jdbcType=TIMESTAMP},
+      #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
       #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR})
       )
@@ -344,9 +344,9 @@
       sd_sendqty = #{item.sd_sendqty,jdbcType=DOUBLE},
       sd_pdqty = #{item.sd_pdqty,jdbcType=DOUBLE},
       sd_remark = #{item.sd_remark,jdbcType=VARCHAR},
-      companyid = #{item.companyid,jdbcType=INTEGER},
+      companyId = #{item.companyId,jdbcType=INTEGER},
       updaterId = #{item.updaterId,jdbcType=INTEGER},
-      updatetime = #{item.updatetime,jdbcType=TIMESTAMP},
+      updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
       sd_text1 = #{item.sd_text1,jdbcType=VARCHAR},
       sd_text2 = #{item.sd_text2,jdbcType=VARCHAR},
       sd_text3 = #{item.sd_text3,jdbcType=VARCHAR},