ReceiptHeaderMapper.xml
4.94 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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.receipt.receiptHeader.mapper.ReceiptHeaderMapper">
<resultMap id="BaseResultMap" type="com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader">
<!--@mbg.generated-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
<result column="companyCode" jdbcType="VARCHAR" property="companyCode" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="receiptType" jdbcType="VARCHAR" property="receiptType" />
<result column="firstStatus" jdbcType="INTEGER" property="firstStatus" />
<result column="lastStatus" jdbcType="INTEGER" property="lastStatus" />
<result column="referCode" jdbcType="VARCHAR" property="referCode" />
<result column="referId" jdbcType="INTEGER" property="referId" />
<result column="referType" jdbcType="VARCHAR" property="referType" />
<result column="scheduledArriveDate" jdbcType="DATE" property="scheduledArriveDate" />
<result column="actualArriveDate" jdbcType="DATE" property="actualArriveDate" />
<result column="recvDock" jdbcType="VARCHAR" property="recvDock" />
<result column="closedAt" jdbcType="DATE" property="closedAt" />
<result column="closedBy" jdbcType="VARCHAR" property="closedBy" />
<result column="startCheckinDatetime" jdbcType="TIMESTAMP" property="startCheckinDatetime" />
<result column="endCheckinDatetime" jdbcType="TIMESTAMP" property="endCheckinDatetime" />
<result column="totalWeight" jdbcType="DECIMAL" property="totalWeight" />
<result column="openWeight" jdbcType="DECIMAL" property="openWeight" />
<result column="totalQty" jdbcType="INTEGER" property="totalQty" />
<result column="totalLines" jdbcType="INTEGER" property="totalLines" />
<result column="toalCases" jdbcType="INTEGER" property="toalCases" />
<result column="totalWeight" jdbcType="DECIMAL" property="totalWeight" />
<result column="totalVolume" jdbcType="DECIMAL" property="totalVolume" />
<result column="receiptNote" jdbcType="VARCHAR" property="receiptNote" />
<result column="locked" jdbcType="INTEGER" property="locked" />
<result column="lockedBy" jdbcType="VARCHAR" property="lockedBy" />
<result column="created" jdbcType="TIMESTAMP" property="created" />
<result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
<result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
<result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" />
<result column="version" jdbcType="INTEGER" property="version" />
<result column="userDef1" jdbcType="VARCHAR" property="userDef1" />
<result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
<result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
<result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
<result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
<result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
<result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
<result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
<result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="pushErrorCount" jdbcType="INTEGER" property="pushErrorCount" />
<result column="pushSuccessStatus" jdbcType="INTEGER" property="pushSuccessStatus" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, warehouseCode, companyCode, code, receiptType, firstStatus, lastStatus, referCode,
referId, referType, scheduledArriveDate, actualArriveDate, recvDock, closedAt, closedBy,
startCheckinDatetime, endCheckinDatetime, totalQty, totalLines, toalCases, totalWeight,openWeight,
totalVolume, receiptNote, locked, lockedBy, created, createdBy, lastUpdated, lastUpdatedBy,
version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8,
processStamp, deleted
</sql>
<select id="selectListByCreated" resultType="com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader">
SELECT r.* from receipt_header r
inner join task_detail t on t.billCode=r.code and
t.status>700 and DATEDIFF(NOW(), t.lastUpdated)=0 GROUP BY r.code
</select>
<select id="createCode" resultType="java.lang.String">
SELECT code FROM receipt_header WHERE receiptType = #{receiptType,jdbcType=VARCHAR} ORDER BY id DESC LIMIT 1
</select>
<select id="getLatestReceipt" resultType="com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader">
select * from receipt_header where warehouseCode = #{warehouseCode, jdbcType=VARCHAR}
and companyCode = #{companyCode, jdbcType= VARCHAR} order by id desc limit 10
</select>
</mapper>