|
@@ -2,116 +2,551 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
<mapper namespace="net.chenlin.dp.modules.api.dao.SaleOrderMapper">
|
|
|
- <!--销售订单-->
|
|
|
- <resultMap id="BaseResultMap" type="net.chenlin.dp.modules.api.vo.YonyouSaleOrder">
|
|
|
- <result column="cSOCode" jdbcType="VARCHAR" property="code" />
|
|
|
- <result column="dDate" jdbcType="VARCHAR" property="date" />
|
|
|
- <result column="cBusType" jdbcType="VARCHAR" property="businesstype" />
|
|
|
- <result column="cSTCode" jdbcType="VARCHAR" property="typecode" />
|
|
|
- <result column="iStatus" jdbcType="VARCHAR" property="state" />
|
|
|
- <result column="cCusCode" jdbcType="VARCHAR" property="custcode" />
|
|
|
- <result column="cCusName" jdbcType="VARCHAR" property="cusname" />
|
|
|
- <result column="cDepCode" jdbcType="VARCHAR" property="deptcode" />
|
|
|
- <result column="cMaker" jdbcType="VARCHAR" property="maker" />
|
|
|
-
|
|
|
- <!--我们可以利用association的select关键字进行查询,他可以关联另一条sql,方便我们进行查询子目录-->
|
|
|
- <association column="cSOCode" jdbcType="VARCHAR" property="entry" select="selectByPid"/>
|
|
|
- </resultMap>
|
|
|
- <resultMap id="SaleOrderMaterial" type="net.chenlin.dp.modules.api.vo.YonyouMaterial">
|
|
|
- <result column="cInvCode" jdbcType="VARCHAR" property="inventorycode" />
|
|
|
- <result column="iQuantity" jdbcType="VARCHAR" property="quantity" />
|
|
|
- <result column="iNum" jdbcType="VARCHAR" property="num" />
|
|
|
- <result column="iUnitPrice" jdbcType="VARCHAR" property="unitprice" />
|
|
|
- <result column="iTaxUnitPrice" jdbcType="VARCHAR" property="taxunitprice" />
|
|
|
- <result column="iMoney" jdbcType="VARCHAR" property="money" />
|
|
|
- <result column="iSum" jdbcType="VARCHAR" property="sum" />
|
|
|
- <result column="iDisCount" jdbcType="VARCHAR" property="discount" />
|
|
|
- <result column="iNatUnitPrice" jdbcType="VARCHAR" property="natdiscount" />
|
|
|
- <result column="iNatMoney" jdbcType="VARCHAR" property="natmoney" />
|
|
|
- <result column="iNatTax" jdbcType="VARCHAR" property="nattax" />
|
|
|
- <result column="iNatSum" jdbcType="VARCHAR" property="natsum" />
|
|
|
- <result column="iNatDisCount" jdbcType="VARCHAR" property="natdiscount" />
|
|
|
- <result column="cInvName" jdbcType="VARCHAR" property="inventoryname" />
|
|
|
- <result column="iTaxRate" jdbcType="VARCHAR" property="taxrate" />
|
|
|
- <result column="iInvExchRate" jdbcType="VARCHAR" property="unitrate" />
|
|
|
- <result column="cUnitID" jdbcType="VARCHAR" property="unitcode" />
|
|
|
- <result column="iRowNo" jdbcType="VARCHAR" property="rowno" />
|
|
|
- <result column="KL" jdbcType="VARCHAR" property="discountrate" />
|
|
|
- <result column="iQuotedPrice" jdbcType="VARCHAR" property="quotedprice" />
|
|
|
- <result column="iQuotedPrice" jdbcType="VARCHAR" property="quotedprice" />
|
|
|
+ <resultMap id="FH" type="net.chenlin.dp.modules.api.vo.SaleOrderFH">
|
|
|
+ <result column="cdlcode" jdbcType="VARCHAR" property="code" />
|
|
|
+ <result column="cstcode" jdbcType="VARCHAR" property="saletype" />
|
|
|
+ <result column="ddate" jdbcType="VARCHAR" property="date" />
|
|
|
+ <result column="cdepcode" jdbcType="VARCHAR" property="deptcode" />
|
|
|
+ <result column="cpersoncode" jdbcType="VARCHAR" property="personcode" />
|
|
|
+ <result column="ccuscode" jdbcType="VARCHAR" property="custcode" />
|
|
|
+ <result column="cshipaddress" jdbcType="VARCHAR" property="cdeliveradd" />
|
|
|
+ <result column="cbustype" jdbcType="VARCHAR" property="operation_type" />
|
|
|
+ <result column="ccusname" jdbcType="VARCHAR" property="cusname" />
|
|
|
+ <result column="dlid" jdbcType="VARCHAR" property="closer" />
|
|
|
</resultMap>
|
|
|
|
|
|
-<!--销售报价单-->
|
|
|
- <resultMap id="SaleOrderBJ" type="net.chenlin.dp.modules.api.vo.SaleOrderBJ">
|
|
|
- <result column="ID" jdbcType="VARCHAR" property="ID" />
|
|
|
- <result column="dDate" jdbcType="VARCHAR" property="dDate" />
|
|
|
- <result column="cCode" jdbcType="VARCHAR" property="cCode" />
|
|
|
- <result column="cCusCode" jdbcType="VARCHAR" property="cCusCode" />
|
|
|
- <result column="cDepCode" jdbcType="VARCHAR" property="cDepCode" />
|
|
|
- <result column="cPersonCode" jdbcType="VARCHAR" property="cPersonCode" />
|
|
|
- <result column="cexch_name" jdbcType="VARCHAR" property="cexch_name" />
|
|
|
- <result column="iExchRate" jdbcType="VARCHAR" property="iExchRate" />
|
|
|
- <result column="iTaxRate" jdbcType="VARCHAR" property="iTaxRate" />
|
|
|
- <result column="cMemo" jdbcType="VARCHAR" property="cMemo" />
|
|
|
- <result column="cMaker" jdbcType="VARCHAR" property="cMaker" />
|
|
|
- <result column="cVerifier" jdbcType="VARCHAR" property="cVerifier" />
|
|
|
- <result column="cCloser" jdbcType="VARCHAR" property="cCloser" />
|
|
|
- <result column="cBusType" jdbcType="VARCHAR" property="cBusType" />
|
|
|
- <!--我们可以利用association的select关键字进行查询,他可以关联另一条sql,方便我们进行查询子目录-->
|
|
|
- <association column="ID" jdbcType="VARCHAR" property="list" select="selectCode"/>
|
|
|
+
|
|
|
+ <resultMap id="FHMin" type="net.chenlin.dp.modules.api.vo.SaleOrderFHMin">
|
|
|
+ <result column="cwhcode" jdbcType="VARCHAR" property="warehouse_code" />
|
|
|
+ <result column="cinvcode" jdbcType="VARCHAR" property="inventory_code" />
|
|
|
+ <result column="iquantity" jdbcType="VARCHAR" property="quantity" />
|
|
|
+ <result column="inum" jdbcType="VARCHAR" property="num" />
|
|
|
+ <result column="iunitprice" jdbcType="VARCHAR" property="price" />
|
|
|
+ <result column="itaxunitprice" jdbcType="VARCHAR" property="taxprice" />
|
|
|
+ <result column="imoney" jdbcType="VARCHAR" property="money" />
|
|
|
+ <result column="itax" jdbcType="VARCHAR" property="tax" />
|
|
|
+ <result column="isum" jdbcType="VARCHAR" property="sum" />
|
|
|
+ <result column="inatunitprice" jdbcType="VARCHAR" property="natprice" />
|
|
|
+ <result column="inatmoney" jdbcType="VARCHAR" property="natmoney" />
|
|
|
+ <result column="inattax" jdbcType="VARCHAR" property="nattax" />
|
|
|
+ <result column="inatsum" jdbcType="VARCHAR" property="natsum" />
|
|
|
+ <result column="cinvname" jdbcType="VARCHAR" property="inventory_name" />
|
|
|
+ <result column="itaxrate" jdbcType="VARCHAR" property="taxrate" />
|
|
|
+ <result column="citemcode" jdbcType="VARCHAR" property="item_code" />
|
|
|
+ <result column="citemname" jdbcType="VARCHAR" property="item_name" />
|
|
|
+ <result column="iinvexchrate" jdbcType="VARCHAR" property="unitrate" />
|
|
|
+ <result column="cunitid" jdbcType="VARCHAR" property="ccomunitcode" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <resultMap id="SaleOrderBJMin" type="net.chenlin.dp.modules.api.vo.SaleOrderBJMin">
|
|
|
- <result column="irowno" jdbcType="VARCHAR" property="irowno" />
|
|
|
- <result column="cInvCode" jdbcType="VARCHAR" property="cInvCode" />
|
|
|
- <result column="iQuantity" jdbcType="VARCHAR" property="iQuantity" />
|
|
|
- <result column="cUnitID" jdbcType="VARCHAR" property="cUnitID" />
|
|
|
- <result column="iInvExchRate" jdbcType="VARCHAR" property="iInvExchRate" />
|
|
|
- <result column="iNum" jdbcType="VARCHAR" property="iNum" />
|
|
|
- <result column="iQuotedPrice" jdbcType="VARCHAR" property="iQuotedPrice" />
|
|
|
- <result column="iUnitPrice" jdbcType="VARCHAR" property="iUnitPrice" />
|
|
|
- <result column="iTaxUnitPrice" jdbcType="VARCHAR" property="iTaxUnitPrice" />
|
|
|
- <result column="iMoney" jdbcType="VARCHAR" property="iMoney" />
|
|
|
- <result column="iTax" jdbcType="VARCHAR" property="iTax" />
|
|
|
- <result column="iSum" jdbcType="VARCHAR" property="iSum" />
|
|
|
- <result column="iDisCount" jdbcType="VARCHAR" property="iDisCount" />
|
|
|
- <result column="iNatUnitPrice" jdbcType="VARCHAR" property="iNatUnitPrice" />
|
|
|
- <result column="iTaxUnitPrice" jdbcType="VARCHAR" property="iTaxUnitPrice" />
|
|
|
- <result column="iNatMoney" jdbcType="VARCHAR" property="iNatMoney" />
|
|
|
- <result column="iNatTax" jdbcType="VARCHAR" property="iNatTax" />
|
|
|
- <result column="iNatSum" jdbcType="VARCHAR" property="iNatSum" />
|
|
|
- <result column="iNatDisCount" jdbcType="VARCHAR" property="iNatDisCount" />
|
|
|
- <result column="cMemo" jdbcType="VARCHAR" property="cMemo" />
|
|
|
- <result column="iTaxRate" jdbcType="VARCHAR" property="iTaxRate" />
|
|
|
- <result column="KL" jdbcType="VARCHAR" property="KL" />
|
|
|
- <result column="cItemCode" jdbcType="VARCHAR" property="cItemCode" />
|
|
|
- <result column="cItem_class" jdbcType="VARCHAR" property="cItem_class" />
|
|
|
- <result column="cItemName" jdbcType="VARCHAR" property="cItemName" />
|
|
|
- <result column="cItem_CName" jdbcType="VARCHAR" property="cItem_CName" />
|
|
|
- <result column="cCusInvCode" jdbcType="VARCHAR" property="cCusInvCode" />
|
|
|
- <result column="cCusInvName" jdbcType="VARCHAR" property="cCusInvName" />
|
|
|
+
|
|
|
+
|
|
|
+ <resultMap id="TH" type="net.chenlin.dp.modules.api.vo.SaleOrderTH">
|
|
|
+ <result column="cdlcode" jdbcType="VARCHAR" property="code" />
|
|
|
+ <result column="cstcode" jdbcType="VARCHAR" property="saletype" />
|
|
|
+ <result column="ddate" jdbcType="VARCHAR" property="date" />
|
|
|
+ <result column="cdepcode" jdbcType="VARCHAR" property="deptcode" />
|
|
|
+ <result column="cpersoncode" jdbcType="VARCHAR" property="personcode" />
|
|
|
+ <result column="ccuscode" jdbcType="VARCHAR" property="custcode" />
|
|
|
+ <result column="cbustype" jdbcType="VARCHAR" property="operation_type" />
|
|
|
+ <result column="ccusname" jdbcType="VARCHAR" property="cusname" />
|
|
|
+ <result column="dlid" jdbcType="VARCHAR" property="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <resultMap id="THMin" type="net.chenlin.dp.modules.api.vo.SaleOrderTHMin">
|
|
|
+ <result column="cwhcode" jdbcType="VARCHAR" property="warehouse_code" />
|
|
|
+ <result column="cinvcode" jdbcType="VARCHAR" property="inventory_code" />
|
|
|
+ <result column="iquantity" jdbcType="VARCHAR" property="quantity" />
|
|
|
+ <result column="iunitprice" jdbcType="VARCHAR" property="price" />
|
|
|
+ <result column="itaxunitprice" jdbcType="VARCHAR" property="taxprice" />
|
|
|
+ <result column="imoney" jdbcType="VARCHAR" property="money" />
|
|
|
+ <result column="itax" jdbcType="VARCHAR" property="tax" />
|
|
|
+ <result column="isum" jdbcType="VARCHAR" property="sum" />
|
|
|
+ <result column="inatunitprice" jdbcType="VARCHAR" property="natprice" />
|
|
|
+ <result column="inatmoney" jdbcType="VARCHAR" property="natmoney" />
|
|
|
+ <result column="inattax" jdbcType="VARCHAR" property="nattax" />
|
|
|
+ <result column="inatsum" jdbcType="VARCHAR" property="natsum" />
|
|
|
+ <result column="cinvname" jdbcType="VARCHAR" property="inventory_name" />
|
|
|
+ <result column="itaxrate" jdbcType="VARCHAR" property="taxrate" />
|
|
|
+ <result column="cunitid" jdbcType="VARCHAR" property="ccomunitcode" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="selectByPid" resultMap="SaleOrderMaterial">
|
|
|
- select cInvCode ,iQuantity ,iNum ,iUnitPrice ,iTaxUnitPrice ,iMoney ,iSum,iDisCount,iNatUnitPrice ,
|
|
|
- iNatMoney ,iNatTax ,iNatSum ,iNatDisCount ,cInvName ,iTaxRate ,iInvExchRate ,cUnitID ,iRowNo from CRM_U8_SO_SOMainItem where cSOCode=#{code};
|
|
|
+
|
|
|
+ <insert id="UInsertSaleOrderBJ">
|
|
|
+ INSERT INTO SA_QuoMain (
|
|
|
+ cSTCode,iVTid,ID,dDate,cCode,cCusCode,cDepCode,cPersonCode,cexch_name,iExchRate,iTaxRate,cMemo,cMaker,cVerifier,cCloser,cBusType,dcreatesystime
|
|
|
+
|
|
|
+ )
|
|
|
+ VALUES (
|
|
|
+ '01',
|
|
|
+ '8048',
|
|
|
+ #{ID},
|
|
|
+ #{dDate},
|
|
|
+ #{cCode},
|
|
|
+ #{cCusCode},
|
|
|
+ #{cDepCode},
|
|
|
+ #{cPersonCode},
|
|
|
+ '人民币',
|
|
|
+ #{iExchRate},
|
|
|
+ #{iTaxRate},
|
|
|
+ #{cMemo},
|
|
|
+ #{cMaker},
|
|
|
+ #{cVerifier},
|
|
|
+ #{cCloser},
|
|
|
+ '普通销售',
|
|
|
+ #{dcreatesystime}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="UInsertSaleOrderBJMin">
|
|
|
+ INSERT INTO SA_QuoDetails (
|
|
|
+ ID,AutoID ,irowno,cInvCode,iQuantity,cUnitID,iInvExchRate,iNum,iQuotedPrice,iUnitPrice,iTaxUnitPrice,iNatMoney,iNatTax,iNatSum,
|
|
|
+ iNatDisCount,cMemo,iTaxRate,KL,cItemCode,cItem_class,cItemName,cItem_CName,cCusInvCode,cCusInvName,imoney,itax,isum,idiscount,inatunitprice)
|
|
|
+ values
|
|
|
+ <foreach collection ="list" item="saleOrderBJMins" index= "index" separator =",">
|
|
|
+ ( #{saleOrderBJMins.ID},
|
|
|
+ #{saleOrderBJMins.AutoID},
|
|
|
+ #{saleOrderBJMins.irowno},
|
|
|
+ #{saleOrderBJMins.cInvCode},
|
|
|
+ #{saleOrderBJMins.iQuantity},
|
|
|
+ #{saleOrderBJMins.cUnitID},
|
|
|
+ #{saleOrderBJMins.iInvExchRate},
|
|
|
+ #{saleOrderBJMins.iNum},
|
|
|
+ #{saleOrderBJMins.iQuotedPrice},
|
|
|
+ #{saleOrderBJMins.iUnitPrice},
|
|
|
+ #{saleOrderBJMins.iTaxUnitPrice},
|
|
|
+ #{saleOrderBJMins.iNatMoney},
|
|
|
+ #{saleOrderBJMins.iNatTax},
|
|
|
+ #{saleOrderBJMins.iNatSum},
|
|
|
+ #{saleOrderBJMins.iNatDisCount},
|
|
|
+ #{saleOrderBJMins.cMemo},
|
|
|
+ #{saleOrderBJMins.iTaxRate} ,
|
|
|
+ #{saleOrderBJMins.KL},
|
|
|
+ #{saleOrderBJMins.cItemCode} ,
|
|
|
+ #{saleOrderBJMins.cItem_class},
|
|
|
+ #{saleOrderBJMins.cItemName},
|
|
|
+ #{saleOrderBJMins.cItem_CName},
|
|
|
+ #{saleOrderBJMins.cCusInvCode},
|
|
|
+ #{saleOrderBJMins.cCusInvName},
|
|
|
+ #{saleOrderBJMins.iMoney},
|
|
|
+ #{saleOrderBJMins.iTax},
|
|
|
+ #{saleOrderBJMins.iSum},
|
|
|
+ #{saleOrderBJMins.iDisCount},
|
|
|
+ #{saleOrderBJMins.iNatUnitPrice}
|
|
|
+ )
|
|
|
+ </foreach >
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="UAddSaleOrder">
|
|
|
+ insert into SO_SOMain(id,cstcode ,ddate ,csocode ,ccuscode ,cdepcode ,
|
|
|
+ cexch_name ,itaxrate ,
|
|
|
+ istatus,cmaker ,ccusname ,cbustype ,dcreatesystime,cMemo,cCusOAddress )
|
|
|
+ values
|
|
|
+ (
|
|
|
+ #{id},
|
|
|
+ #{typecode},
|
|
|
+ #{date},
|
|
|
+ #{code},
|
|
|
+ #{custcode},
|
|
|
+ #{deptcode},
|
|
|
+ '人民币',
|
|
|
+ #{taxrate},
|
|
|
+ #{state},
|
|
|
+ #{maker},
|
|
|
+ #{cusname},
|
|
|
+ #{businesstype},
|
|
|
+ #{createsystime},
|
|
|
+ #{memo},
|
|
|
+ #{sendaddress}
|
|
|
+ )
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="UAddSaleOrderMin">
|
|
|
+ insert into SO_SODetails(
|
|
|
+ id,
|
|
|
+ dbclosesystime,
|
|
|
+ dbclosedate,
|
|
|
+ ccorvouchtype,
|
|
|
+ icorrowno,
|
|
|
+ idemandtype,
|
|
|
+ cSOCode,
|
|
|
+ cInvCode,
|
|
|
+ dPreDate,
|
|
|
+ iQuantity,
|
|
|
+ inum,
|
|
|
+ iQuotedPrice,
|
|
|
+ iUnitPrice,
|
|
|
+ iTaxUnitPrice,
|
|
|
+ iMoney,
|
|
|
+ iSum,
|
|
|
+ iDisCount,
|
|
|
+ iNatUnitPrice ,
|
|
|
+ iNatMoney,
|
|
|
+ iNatTax,
|
|
|
+ iNatSum,
|
|
|
+ iNatDisCount,
|
|
|
+ KL,
|
|
|
+ cInvName,
|
|
|
+ iTaxRate,
|
|
|
+ cItemCode,
|
|
|
+ cItem_class,
|
|
|
+ cItemName,
|
|
|
+ cItem_CName,
|
|
|
+ iInvExchRate,
|
|
|
+ cUnitID,
|
|
|
+ cQuoCode,
|
|
|
+ iQuoID,
|
|
|
+ cSCloser,
|
|
|
+ dPreMoDate,
|
|
|
+ iRowNo,
|
|
|
+ cCusInvCode,
|
|
|
+ cCusInvName,
|
|
|
+ iPPartID,
|
|
|
+ iPPartQty,
|
|
|
+ bOrderBOM,
|
|
|
+ bOrderBOMOver,
|
|
|
+ isosid
|
|
|
+ )
|
|
|
+ values
|
|
|
+ <foreach collection ="list" item="yonyouMaterials" index= "index" separator =",">
|
|
|
+ (
|
|
|
+ #{yonyouMaterials.id},
|
|
|
+ #{yonyouMaterials.dbclosesystime},
|
|
|
+ #{yonyouMaterials.dbclosedate},
|
|
|
+ #{yonyouMaterials.ccorvouchtype},
|
|
|
+ #{yonyouMaterials.icorrowno},
|
|
|
+ #{yonyouMaterials.idemandtype},
|
|
|
+ #{yonyouMaterials.code},
|
|
|
+ #{yonyouMaterials.inventorycode},
|
|
|
+ #{yonyouMaterials.dpredate},
|
|
|
+ #{yonyouMaterials.quantity},
|
|
|
+ #{yonyouMaterials.num},
|
|
|
+ #{yonyouMaterials.quotedprice},
|
|
|
+ #{yonyouMaterials.unitprice},
|
|
|
+ #{yonyouMaterials.taxunitprice},
|
|
|
+ #{yonyouMaterials.money},
|
|
|
+ #{yonyouMaterials.sum},
|
|
|
+ #{yonyouMaterials.discount},
|
|
|
+ #{yonyouMaterials.natunitprice},
|
|
|
+ #{yonyouMaterials.natmoney},
|
|
|
+ #{yonyouMaterials.nattax},
|
|
|
+ #{yonyouMaterials.natsum},
|
|
|
+ #{yonyouMaterials.natdiscount},
|
|
|
+ #{yonyouMaterials.kl},
|
|
|
+ #{yonyouMaterials.inventoryname},
|
|
|
+ #{yonyouMaterials.taxrate},
|
|
|
+ #{yonyouMaterials.cltemcode},
|
|
|
+ #{yonyouMaterials.cltemClass},
|
|
|
+ #{yonyouMaterials.cltemName},
|
|
|
+ #{yonyouMaterials.cltemCName},
|
|
|
+ #{yonyouMaterials.unitrate},
|
|
|
+ #{yonyouMaterials.unitcode},
|
|
|
+ #{yonyouMaterials.cquocode},
|
|
|
+ #{yonyouMaterials.iquoid},
|
|
|
+ #{yonyouMaterials.cscloser},
|
|
|
+ #{yonyouMaterials.dpremodate},
|
|
|
+ #{yonyouMaterials.rowno},
|
|
|
+ #{yonyouMaterials.ccusinvcode},
|
|
|
+ #{yonyouMaterials.ccusinvname},
|
|
|
+ #{yonyouMaterials.ippartid},
|
|
|
+ #{yonyouMaterials.ippartqty},
|
|
|
+ #{yonyouMaterials.borderbom},
|
|
|
+ #{yonyouMaterials.borderbomover},
|
|
|
+ #{yonyouMaterials.AutoID}
|
|
|
+ )
|
|
|
+ </foreach >
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="UAddSaleOderFTH">
|
|
|
+ insert into DispatchList(dlid,
|
|
|
+ cdlcode,cvouchtype,cstcode,ddate,crdcode,cdepcode,cpersoncode,ccuscode,csccode,cshipaddress,cexch_name,
|
|
|
+ itaxrate,breturnflag, cmaker,ccusname,cbustype,iVTid ,cSOCode) values
|
|
|
+ ( #{dlid},
|
|
|
+ #{cdlcode},
|
|
|
+ '05',
|
|
|
+ '01',
|
|
|
+ #{ddate},
|
|
|
+ #{crdcode},
|
|
|
+ #{cdepcode},
|
|
|
+ #{cpersoncode},
|
|
|
+ #{ccuscode},
|
|
|
+ #{csccode},
|
|
|
+ #{cshipaddress},
|
|
|
+ '人民币',
|
|
|
+ #{itaxrate},
|
|
|
+ #{breturnflag},
|
|
|
+ #{cmaker},
|
|
|
+ #{ccusname},
|
|
|
+ '普通销售',
|
|
|
+ #{poid},
|
|
|
+ #{cVouchID}
|
|
|
+ )
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <insert id="UAddSaleOrderFTHMin">
|
|
|
+ insert into DispatchLists(iDLsID,dlid,icorid,cwhcode,cinvcode,iquantity,inum,iunitprice,itaxunitprice,imoney,
|
|
|
+ itax,isum,inatunitprice,inatmoney,inattax,inatsum,isosid, cinvname,itaxrate,citemcode,citem_class,citemname,
|
|
|
+ citem_cname,iinvexchrate,cunitid,csocode,ccusinvcode,ccusinvname,cMemo)values
|
|
|
+ <foreach collection ="list" item="saleOrderFTHMins" index= "index" separator =",">
|
|
|
+ ( #{saleOrderFTHMins.autoid},
|
|
|
+ #{saleOrderFTHMins.dlid},
|
|
|
+ #{saleOrderFTHMins.icorid},
|
|
|
+ #{saleOrderFTHMins.cwhcode},
|
|
|
+ #{saleOrderFTHMins.cinvcode},
|
|
|
+ #{saleOrderFTHMins.iquantity},
|
|
|
+ #{saleOrderFTHMins.inum},
|
|
|
+ #{saleOrderFTHMins.iunitprice},
|
|
|
+ #{saleOrderFTHMins.itaxunitprice},
|
|
|
+ #{saleOrderFTHMins.imoney},
|
|
|
+ #{saleOrderFTHMins.itax},
|
|
|
+ #{saleOrderFTHMins.isum},
|
|
|
+ #{saleOrderFTHMins.inatunitprice},
|
|
|
+ #{saleOrderFTHMins.inatmoney},
|
|
|
+ #{saleOrderFTHMins.inattax},
|
|
|
+ #{saleOrderFTHMins.inatsum},
|
|
|
+ #{saleOrderFTHMins.isosid},
|
|
|
+ #{saleOrderFTHMins.cinvname},
|
|
|
+ #{saleOrderFTHMins.itaxrate},
|
|
|
+ #{saleOrderFTHMins.citemcode},
|
|
|
+ #{saleOrderFTHMins.citemclass},
|
|
|
+ #{saleOrderFTHMins.citemname},
|
|
|
+ #{saleOrderFTHMins.citemcname},
|
|
|
+ #{saleOrderFTHMins.iinvexchrate},
|
|
|
+ #{saleOrderFTHMins.cunitid},
|
|
|
+ #{saleOrderFTHMins.csocode},
|
|
|
+ #{saleOrderFTHMins.ccusinvcode},
|
|
|
+ #{saleOrderFTHMins.ccusinvname},
|
|
|
+ #{saleOrderFTHMins.cdefine33}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+ </insert>
|
|
|
+ <update id="UpdateSaleOrder">
|
|
|
+ update CRM_U8_SO_SOMain set issyu8='1' where id=#{id}
|
|
|
+ </update>
|
|
|
+ <update id="UpdateSaleOrderBJ">
|
|
|
+ update CRM_U8_SA_QuoMain set issyu8='1' where id=#{id}
|
|
|
+ </update>
|
|
|
+ <update id="UpdateKSDDKOrder">
|
|
|
+ update CRM_U8_Deduction set issyu8='1' where DLID=#{id}
|
|
|
+
|
|
|
+ </update>
|
|
|
+ <update id="UpdateKSDTHOrder">
|
|
|
+ update CRM_U8_DispatchList set issyu8='1' where DLID=#{id}
|
|
|
+ </update>
|
|
|
+ <update id="UpdateKSDTKOrder">
|
|
|
+ update CRM_U8_Refund set issyu8='1' where cVouchID=#{id}
|
|
|
+
|
|
|
+ </update>
|
|
|
+ <update id="UpdateDYDOrder">
|
|
|
+ update CRM_U8_customEntity4__c set issyu8='1' where id=#{id}
|
|
|
+ </update>
|
|
|
+ <update id="UpdateSYDOrder">
|
|
|
+ update CRM_U8_customEntity12__c set issyu8='1' where id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="SaleOrderBJList" resultType="net.chenlin.dp.modules.api.vo.SaleOrderBJ">
|
|
|
+ select ID,dDate,cCode,cCusCode,cDepCode,cPersonCode,cexch_name as 'cexchName',iExchRate,(iTaxRate*100) as 'iTaxRate',cMemo,cMaker,cVerifier,cCloser,cBusType
|
|
|
+ from CRM_U8_SA_QuoMain
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
- <select id="SaleOrderList" resultMap="BaseResultMap">
|
|
|
- select cSOCode,convert(varchar(10),dDate,120) as 'dDate',cBusType,cSTCode,iStatus,cCusCode,cCusName,cDepCode,cMaker from CRM_U8_SO_SOMain
|
|
|
+ <select id="selectCode" resultType="net.chenlin.dp.modules.api.vo.SaleOrderBJMin">
|
|
|
+ select a.ID,a.AutoID,a.irowno,a.cInvCode,a.iQuantity,a.cUnitID,a.iInvExchRate,a.iNum,a.iQuotedPrice,a.iUnitPrice,a.iTaxUnitPrice,a.iNatMoney,a.iNatTax,a.iNatSum,
|
|
|
+ a.iNatDisCount,a.cMemo,(a.iTaxRate*100) as 'iTaxRate',a.KL,b.cItemCode,b.cItem_class,b.cItemName,b.cItem_CName,a.cCusInvCode,a.cCusInvName,a.iMoney,a.iTax,a.iSum,a.iDisCount,a.iNatUnitPrice from CRM_U8_SA_QuoDetails a left join CRM_U8_SA_QuoMain b on a.id=b.id
|
|
|
+ where a.id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="CrmSaleOrderList" resultType="net.chenlin.dp.modules.api.vo.YonyouSaleOrder">
|
|
|
+ select id as 'id', cstcode as 'typecode',ddate as 'date',csocode as 'code',ccuscode as 'custcode',cdepcode as 'deptcode',
|
|
|
+ cexch_name as 'currency',iexchrate as 'iExchRate',itaxrate as 'taxrate',
|
|
|
+ istatus as 'state',cmaker as 'maker',ccusname as 'cusname',cbustype as 'businesstype',dcreatesystime as 'createsystime'
|
|
|
+ from CRM_U8_SO_SOMain
|
|
|
</select>
|
|
|
+ <select id="CrmSaleMaterialList" resultType="net.chenlin.dp.modules.api.vo.YonyouMaterial">
|
|
|
+ select a.id as 'id',
|
|
|
+ a.AutoID as 'AutoID',
|
|
|
+ a.dbclosesystime as 'dbclosesystime',
|
|
|
+ a.dbclosedate as 'dbclosedate',
|
|
|
+ a.ccorvouchtype as 'ccorvouchtype',
|
|
|
+ a.icorrowno as 'icorrowno',
|
|
|
+ a.idemandtype as 'idemandtype',
|
|
|
+ a.cSOCode as 'code',
|
|
|
+ a.cInvCode as 'inventorycode',
|
|
|
+ a.dPreDate as 'dpredate',
|
|
|
+ a.iQuantity as 'quantity',
|
|
|
+ a.inum as 'num',
|
|
|
+ a.iQuotedPrice as 'quotedprice',
|
|
|
+ a.iUnitPrice as 'unitprice',
|
|
|
+ a.iTaxUnitPrice as 'taxunitprice',
|
|
|
+ a.iMoney as 'money',
|
|
|
+ a.iSum as 'sum',
|
|
|
+ a.iDisCount as 'discount',
|
|
|
+ a.iNatUnitPrice as 'natunitprice',
|
|
|
+ a.iNatMoney as 'natmoney',
|
|
|
+ a.iNatTax as 'nattax',
|
|
|
+ a.iNatSum as 'natsum',
|
|
|
+ a.iNatDisCount as 'natdiscount',
|
|
|
+ a.KL as 'kl',
|
|
|
+ a.cInvName as 'inventoryname',
|
|
|
+ a.iTaxRate as 'taxrate',
|
|
|
+ b.cItemCode as 'cltemcode',
|
|
|
+ b.cItem_class as 'cltemClass',
|
|
|
+ b.cItemName as 'cltemName',
|
|
|
+ b.cItem_CName as 'cltemCName',
|
|
|
+ a.iInvExchRate as 'unitrate',
|
|
|
+ a.cUnitID as 'unitcode',
|
|
|
+ a.cQuoCode as 'cquocode',
|
|
|
+ a.iQuoID as 'iquoid',
|
|
|
+ a.cSCloser as 'cscloser',
|
|
|
+ a.dPreMoDate as 'dpremodate',
|
|
|
+ a.iRowNo as 'rowno',
|
|
|
+ a.cCusInvCode as 'ccusinvcode',
|
|
|
+ a.cCusInvName as 'ccusinvname',
|
|
|
+ a.iPPartID as 'ippartid',
|
|
|
+ a.iPPartQty as 'ippartqty',
|
|
|
+ a.bOrderBOM as 'borderbom',
|
|
|
+ a.bOrderBOMOver as 'borderbomover'
|
|
|
|
|
|
+ from CRM_U8_SO_SOMainItem a left join CRM_U8_SO_SOMain b on a.id=b.id where a.id=#{id}
|
|
|
|
|
|
+ </select>
|
|
|
+ <select id="CrmKSOrderTHList" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTH">
|
|
|
+ select cVouchID,dlid,
|
|
|
+ cdlcode,cvouchtype,cstcode,ddate,crdcode,cdepcode,cpersoncode,ccuscode,csccode,cshipaddress,cexch_name as 'cexchname',iexchrate,
|
|
|
+ itaxrate,breturnflag, cmaker,ccusname,cbustype from crm_u8_DispatchList
|
|
|
+ </select>
|
|
|
+ <select id="CrmKSOrderTHMinList" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTHMin">
|
|
|
+ select a.autoid,a.dlid,a.icorid,a.cwhcode,a.cinvcode,a.iquantity,a.inum,a.iunitprice,a.itaxunitprice,a.imoney,a.itax,a.isum, a.inatunitprice,a.inatmoney,a.inattax,a.inatsum,a.isosid,a.cinvname,a.itaxrate,b.citemcode,b.citem_class citemclass,a.iinvexchrate,a.cunitid,a.csocode,a.ccusinvcode,a.ccusinvname
|
|
|
+ from CRM_U8_DispatchItem a
|
|
|
+ left join CRM_U8_DispatchList b on a.dlid=a.dlid
|
|
|
+ where a.dlid=#{id}
|
|
|
|
|
|
- <select id="SaleOrderBJList" resultMap="SaleOrderBJ">
|
|
|
- select ID,dDate,cCode,cCusCode,cDepCode,cPersonCode,cexch_name,iExchRate,iTaxRate,cMemo,cMaker,cVerifier,cCloser,cBusType
|
|
|
- from CRM_U8_SA_QuoMain
|
|
|
+ </select>
|
|
|
+ <select id="CrmKSDOrderFHList" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTH">
|
|
|
+ select dlid,cVouchID,
|
|
|
+ cdlcode,cvouchtype,cstcode,ddate,crdcode,cdepcode,cpersoncode,ccuscode,csccode,cshipaddress,cexch_name as 'cexchname',iexchrate,
|
|
|
+ itaxrate,breturnflag, cmaker,ccusname,cbustype from CRM_U8_Deduction
|
|
|
+ </select>
|
|
|
+ <select id="CrmKSDOrderFHMin" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTHMin">
|
|
|
+ select a.autoid,a.dlid,a.cinvcode,a.iquantity, a.iunitprice,a.itaxunitprice,a.imoney,a.itax,a.isum,
|
|
|
+ a.inatunitprice,a.inatmoney,a.inattax,a.inatsum,a.cinvname,a.itaxrate,b.citemcode,b.citem_class as 'citemclass',a.citemname,
|
|
|
+ a.citem_cname as 'citemcname', a.cunitid,a.cdefine33
|
|
|
+ from CRM_U8_DeductionItem a left join CRM_U8_Deduction b
|
|
|
+ on a.dlid=b.dlid
|
|
|
|
|
|
+ where a.dlid=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="CrmSaleOrderCode" resultType="java.lang.String">
|
|
|
+ select max( iDLsID)
|
|
|
+ from DispatchLists
|
|
|
+ </select>
|
|
|
+ <select id="CrmIKSDOrder" resultMap="FH">
|
|
|
+ select
|
|
|
+ cdlcode ,convert(varchar(10),ddate,120) as 'ddate',crdcode,cdepcode,cpersoncode,ccuscode,csccode,cshipaddress,
|
|
|
+ ccusname,dlid from CRM_U8_Deduction
|
|
|
+ </select>
|
|
|
+ <select id="CrmIKSDOrderMin" resultMap="FHMin">
|
|
|
+ select cinvcode,iquantity, iunitprice, itaxunitprice,imoney,itax,isum,
|
|
|
+ inatunitprice,inatmoney,inattax,inatsum,cinvname,(itaxrate*100) as 'itaxrate',citemcode,citem_class as 'citemclass',citemname,
|
|
|
+ citem_cname as 'citemcname', cunitid
|
|
|
+ from CRM_U8_DeductionItem where dlid=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="CrmSaleOrderMinCode" resultType="java.lang.String">
|
|
|
+ select max(iSOsID)
|
|
|
+ from SO_SODetails
|
|
|
+ </select>
|
|
|
+ <select id="CrmDYDOrder" resultType="net.chenlin.dp.modules.api.vo.YonyouSaleOrder">
|
|
|
+ select id,cstcode as 'typecode',ddate as 'date',csocode as 'code',ccuscode as 'custcode',cdepcode as 'deptcode',cpersoncode as 'personcode',
|
|
|
+ ccusoaddress as 'sendaddress',itaxrate as 'taxrate',cmemo as 'memo',cmaker as 'maker',ccusname as 'cusname',cbustype as 'businesstype',
|
|
|
+ dcreatesystime as 'createsystime',citemcode,citem_class,citemname,citem_cname from crm_u8_customentity4__c
|
|
|
+ </select>
|
|
|
+ <select id="CrmDYDOrderMin" resultType="net.chenlin.dp.modules.api.vo.YonyouMaterial">
|
|
|
+ select a.id as 'id',a.cinvname as 'inventoryname',a.cinvcode as'inventorycode',a.iquantity as 'quantity'
|
|
|
+ ,b.citemcode as 'cltemcode',b.citem_class as 'cltemClass' from CRM_U8_customEntity5__c a left join CRM_U8_customEntity4__c b on a.id=b.id
|
|
|
+ where a.id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="CrmSYDOrder" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTH">
|
|
|
+ select id as 'dlid', ddate as 'ddate',csocode as 'cdlcode',ccuscode as 'ccuscode',cdepcode as 'cdepcode',
|
|
|
+ cpersoncode as 'cpersoncode',ccusoaddress as 'cshipaddress',itaxrate as 'itaxrate',cmemo as 'bz',cmaker as 'cmaker',
|
|
|
+ ccusname as 'ccusname',cbustype as 'cbustype' from CRM_U8_customEntity12__c
|
|
|
+ </select>
|
|
|
+ <select id="CrmSYDOrderMin" resultType="net.chenlin.dp.modules.api.vo.SaleOrderFTHMin">
|
|
|
+ select a.id as 'dlid',a.cinvname as 'cinvname',a.cinvcode as'cinvcode',a.iquantity as 'iquantity'
|
|
|
+ ,b.citemcode,b.citem_class as 'citemclass' from CRM_U8_customEntity13__c a left join CRM_U8_customEntity12__c b on a.id=b.id
|
|
|
+ where a.id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="SaleOrderMaxId" resultType="java.lang.String">
|
|
|
+ select max(id) from SO_SOMain
|
|
|
+ </select>
|
|
|
+ <select id="SaleOrderBJMaxId" resultType="java.lang.String">
|
|
|
+ select max(id) from SA_QuoMain
|
|
|
+ </select>
|
|
|
+ <select id="SaleOrderFTHMaxId" resultType="java.lang.String">
|
|
|
+ select max(DLID) from DispatchList
|
|
|
</select>
|
|
|
+ <select id="CrmISYDOrder" resultMap="FH">
|
|
|
+ select id as 'dlid', convert(varchar(10),ddate,120) as 'ddate' ,csocode as 'cdlcode',ccuscode ,cdepcode ,
|
|
|
+ cpersoncode ,ccusoaddress as 'cshipaddress',
|
|
|
+ cmaker as 'maker',
|
|
|
+ ccusname from CRM_U8_customEntity12__c
|
|
|
+</select>
|
|
|
+ <select id="CrmISYDOrderMin" resultMap="FHMin">
|
|
|
+ select a.id as 'dlid',a.cinvname as 'cinvname',a.cinvcode as'cinvcode',a.iquantity as 'iquantity'
|
|
|
+ ,b.citemcode,b.citem_class as 'citemclass' from CRM_U8_customEntity13__c a left join CRM_U8_customEntity12__c b on a.id=b.id
|
|
|
+ where a.id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="CrmIKSDOrderTH" resultMap="TH">
|
|
|
+ select cVouchID as 'cdlcode',dlid
|
|
|
+ ,cstcode,convert(varchar(10),ddate,120) as 'ddate',cdepcode,cpersoncode,ccuscode,ccusname from crm_u8_DispatchList
|
|
|
+ </select>
|
|
|
+ <select id="CrmIKSDOrderTHMin" resultMap="THMin">
|
|
|
+ select a.cwhcode,a.cinvcode,a.iquantity,a.iunitprice,a.itaxunitprice,a.imoney,
|
|
|
+ a.itax,a.isum, a.inatunitprice,a.inatmoney,a.inattax,a.inatsum,a.cinvname,(a.itaxrate*100) as 'itaxrate',
|
|
|
+ a.cunitid
|
|
|
+ from CRM_U8_DispatchItem a
|
|
|
+
|
|
|
+ where a.dlid=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="ISaleOrderList" resultType="net.chenlin.dp.modules.api.vo.ISaleOrder">
|
|
|
+ select id as 'closer', convert(varchar(10),ddate,120) as 'date',csocode as 'code',ccuscode as 'custcode',cdepcode as 'deptcode',
|
|
|
+
|
|
|
+ (iTaxRate*100) as 'taxrate', cmaker as 'maker',ccusname as 'cusname'
|
|
|
+ from CRM_U8_SO_SOMain
|
|
|
+ </select>
|
|
|
+ <select id="ISaleOrderMin" resultType="net.chenlin.dp.modules.api.vo.ISaleOrderMin">
|
|
|
|
|
|
- <select id="selectCode" resultMap="SaleOrderBJMin">
|
|
|
- select irowno,cInvCode,iQuantity,cUnitID,iInvExchRate,iNum,iQuotedPrice,iUnitPrice,iTaxUnitPrice,iNatMoney,iNatTax,iNatSum,
|
|
|
- iNatDisCount,cMemo,iTaxRate,KL,cItemCode,cItem_class,cItemName,cItem_CName,cCusInvCode,cCusInvName from CRM_U8_SA_QuoDetails where ID=#{ID}
|
|
|
|
|
|
+ select
|
|
|
+ a.AutoID as 'define28',
|
|
|
+ a.cSOCode as 'code',
|
|
|
+ a.cInvCode as 'inventorycode',
|
|
|
+ a.iQuantity as 'quantity',
|
|
|
+ a.inum as 'num',
|
|
|
+ a.iQuotedPrice as 'quotedprice',
|
|
|
+ a.iUnitPrice as 'unitprice',
|
|
|
+ a.iTaxUnitPrice as 'taxunitprice',
|
|
|
+ a.KL as 'discountrate',
|
|
|
+ a.cInvName as 'inventoryname',
|
|
|
+ (a.iTaxRate*100)as 'taxrate',
|
|
|
+ a.iInvExchRate as 'unitrate',
|
|
|
+ a.cUnitID as 'unitcode',
|
|
|
+ a.iRowNo as 'rowno'
|
|
|
+ from CRM_U8_SO_SOMainItem a where a.id=#{id}
|
|
|
</select>
|
|
|
+ <select id="IDYDOrder" resultType="net.chenlin.dp.modules.api.vo.ISaleOrder">
|
|
|
+ select id as 'closer',convert(varchar(10),ddate,120) as 'date',csocode as 'code',ccuscode as 'custcode',cdepcode as 'deptcode',cpersoncode as 'personcode',
|
|
|
+ ccusoaddress as 'sendaddress',(itaxrate*100) as 'taxrate',cmemo as 'memo',cmaker as 'maker',ccusname as 'cusname'
|
|
|
+ from crm_u8_customentity4__c
|
|
|
+ </select>
|
|
|
+ <select id="IDYDOrderMin" resultType="net.chenlin.dp.modules.api.vo.ISaleOrderMin">
|
|
|
+ select a.cinvname as 'inventoryname',a.cinvcode as'inventorycode',a.iquantity as 'quantity'
|
|
|
+ from CRM_U8_customEntity5__c a
|
|
|
+ where a.id=#{id}
|
|
|
+ </select>
|
|
|
+ <select id="SaleOrderBJMinMaxId" resultType="java.lang.String">
|
|
|
+ select max(AutoID) from SA_QuoDetails
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|