ShipmentsPlanMapper.xml
2.55 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
<?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.ShipmentsPlanMapper">
<resultMap id="ShipmentsPlan" type="com.lframework.xingyun.sc.entity.ShipmentsPlan">
<id column="id" property="id"/>
<result column="workshop_id" property="workshopId"/>
<result column="workshop_name" property="workshopName"/>
<result column="status" property="status"/>
<result column="tomo_pre_ship_date" property="tomoPreShipDate"/>
<result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/>
<result column="create_by_id" property="createById"/>
<result column="update_by_id" property="updateById"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="ShipmentsPlan_sql">
SELECT
tb.id,
tb.workshop_id,
w.name AS workshop_name,
tb.status,
tb.tomo_pre_ship_date,
tb.af_tomo_pre_ship_date,
tb.create_by_id,
tb.update_by_id,
tb.create_time,
tb.update_time
FROM shipments_plan AS tb
INNER JOIN base_data_workshop w ON tb.workshop_id = w.id
</sql>
<select id="query" resultMap="ShipmentsPlan">
<include refid="ShipmentsPlan_sql"/>
<where>
<if test="vo.workshopId != null and vo.workshopId != ''">
AND tb.workshop_id = #{vo.workshopId}
</if>
<if test="vo.workshopCodeList != null and vo.workshopCodeList.size() > 0">
AND w.code IN
<foreach collection="vo.workshopCodeList" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</if>
<if test="vo.status != null and vo.status != ''">
AND tb.status = #{vo.status}
</if>
<if test="vo.createStartTime != null">
AND tb.create_time >= #{vo.createStartTime}
</if>
<if test="vo.createEndTime != null">
AND tb.create_time <= #{vo.createEndTime}
</if>
</where>
ORDER BY tb.create_time DESC
</select>
<select id="getById" resultType="com.lframework.xingyun.sc.entity.ShipmentsPlan">
<include refid="ShipmentsPlan_sql"/>
<where>
AND tb.id = #{id}
</where>
</select>
</mapper>