ReplenishmentOrderMapper.xml
3.24 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
<?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.lframework.xingyun.sc.mappers.ReplenishmentOrderMapper">
<resultMap id="ReplenishmentOrder" type="com.lframework.xingyun.sc.entity.ReplenishmentOrder">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="workshop_id" property="workshopId"/>
<result column="dept_id" property="deptId"/>
<result column="customer_id" property="customerId"/>
<result column="origin_plan_ship_date" property="originPlanShipDate"/>
<result column="purchase_order_id" property="purchaseOrderId"/>
<result column="total_quantity" property="totalQuantity"/>
<result column="total_shipped_quantity" property="totalShippedQuantity"/>
<result column="total_supplementary_quantity" property="totalSupplementaryQuantity"/>
<result column="status" property="status"/>
<result column="completed" property="completed"/>
<result column="create_by_id" property="createById"/>
<result column="create_by" property="createBy"/>
<result column="update_by_id" property="updateById"/>
<result column="update_by" property="updateBy"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="ReplenishmentOrder_sql">
SELECT tb.id,
tb.code,
tb.workshop_id,
tb.dept_id,
tb.customer_id,
tb.origin_plan_ship_date,
tb.purchase_order_id,
tb.total_quantity,
tb.total_shipped_quantity,
tb.total_supplementary_quantity,
tb.status,
tb.completed,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM tbl_replenishment_order AS tb
</sql>
<select id="query" resultMap="ReplenishmentOrder">
<include refid="ReplenishmentOrder_sql"/>
<where>
<if test="vo.code != null and vo.code != ''">
AND tb.code LIKE CONCAT('%', #{vo.code}, '%')
</if>
<if test="vo.workshopId != null and vo.workshopId != ''">
AND tb.workshop_id = #{vo.workshopId}
</if>
<if test="vo.createTime != null">
AND tb.create_time = #{vo.createTime}
</if>
<if test="vo.customerIdList != null and vo.customerIdList.size() > 0">
AND tb.customer_id IN
<foreach collection="vo.customerIdList" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</if>
<if test="vo.applicationDateStart != null">
AND tb.create_time >= #{vo.applicationDateStart}
</if>
<if test="vo.applicationDateEnd != null">
AND tb.create_time <= #{vo.applicationDateEnd}
</if>
</where>
order by tb.create_time desc
</select>
</mapper>