ShipmentHeaderMapper.xml
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderMapper">
<insert id="HeaderToHistory" parameterType="string">
INSERT INTO shipment_header_history (
code,warehouseCode,companyId,sourceCode,sourcePlatform,shipmentTypeId,shipTo,priority,station,totalQty,
totalLines,remark,uploadremark,uploadTime,appointmentTime,firstStatus,lastStatus,uploadStatus,created,
createdBy,lastUpdated,lastUpdatedBy,enable,deleted,userDef1,userDef2,userDef3)
SELECT
code,warehouseCode,companyId,sourceCode,sourcePlatform,shipmentTypeId,shipTo,priority,station,totalQty,
totalLines,remark,uploadremark,uploadTime,appointmentTime,firstStatus,lastStatus,uploadStatus,created,
createdBy,lastUpdated,lastUpdatedBy,enable,1,userDef1,userDef2,userDef3
FROM shipment_header WHERE code = #{code,jdbcType=VARCHAR}
</insert>
<insert id="DetailToHistory" parameterType="string">
INSERT INTO shipment_detail_history (
sourceLine,shipmentCode,materialCode,batch,lot,project,manufactureDate,agingDate,inventoryStatus,qty,
price,created,createdBy,lastUpdated,lastUpdatedBy,enable,deleted,userDef1,userDef2,userDef3)
SELECT
sourceLine,shipmentCode,materialCode,batch,lot,project,manufactureDate,agingDate,inventoryStatus,qty,
price,created,createdBy,lastUpdated,lastUpdatedBy,enable,1,userDef1,userDef2,userDef3
FROM shipment_detail WHERE shipmentCode = #{code,jdbcType=VARCHAR}
</insert>
<select id="list" resultType="com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader">
select * from shipment_header
<where>
<if test="shipmentCode != null">
and code = #{shipmentCode}
</if>
<if test="shipmentType != 0">
and shipmentTypeId = #{shipmentType}
</if>
<if test="company != 0">
and companyId = #{company}
</if>
<if test="firstStatus != null">
and firstStatus = #{firstStatus}
</if>
<if test="lastStatus != null">
and lastStatus = #{lastStatus}
</if>
<if test="beginTime != null">
and created >= #{beginTime}
</if>
<if test="endTime != null">
and created <= #{endTime}
</if>
</where>
</select>
</mapper>