DriverSchedulingExpandMapper.xml
6.67 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?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.ruoyi.expand.mapper.DriverSchedulingExpandMapper">
<resultMap type="DriverSchedulingExpand" id="DriverSchedulingExpandResult">
<result property="id" column="id" />
<result property="status" column="status" />
<result property="masterJobCode" column="master_job_code" />
<result property="slaveJobCode" column="slave_job_code" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
<result property="type" column="type" />
</resultMap>
<resultMap id="DriverSchedulingExpandDto" type="com.ruoyi.pojo.vo.ExpandResponseVo">
<result property="status" column="status" />
<result property="masterJobCode" column="master_job_code" />
<result property="slaveJobCode" column="slave_job_code" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
<result property="materName" column="materName" />
<result property="slaveName" column="slaveName" />
<result property="slaveFleetName" column="slaveFleetName" />
<result property="slavePosts" column="slavePosts" />
<result property="type" column="type" />
</resultMap>
<sql id="selectDriverSchedulingExpandVo">
select id, status, master_job_code, slave_job_code, start_date, end_date, create_time, update_time, create_by, update_by, remark,type from driver_scheduling_expand
</sql>
<select id="selectDriverSchedulingExpandList" parameterType="DriverSchedulingExpand" resultMap="DriverSchedulingExpandResult">
<include refid="selectDriverSchedulingExpandVo"/>
<where>
<if test="status != null "> and status = #{status}</if>
<if test="masterJobCode != null and masterJobCode != ''"> and master_job_code = #{masterJobCode}</if>
<if test="slaveJobCode != null and slaveJobCode != ''"> and slave_job_code = #{slaveJobCode}</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if>
</where>
</select>
<select id="selectDriverSchedulingExpandById" parameterType="Long" resultMap="DriverSchedulingExpandResult">
<include refid="selectDriverSchedulingExpandVo"/>
where id = #{id}
</select>
<select id="queryExpandListByEntity" resultMap="DriverSchedulingExpandDto" resultType="com.ruoyi.pojo.vo.ExpandResponseVo">
select driver.personnel_name slaveName,
driver.fleet_name slaveFleetName,
driver.posts slavePosts,expand.*
from driver_scheduling_expand expand,driver
where driver.job_code = expand.slave_job_code
and start_date <= NOW()
<if test="status != null">
and expand.`status` = #{status}
</if>
<if test="masterJobCode != null">
and expand.master_job_code = #{masterJobCode}
</if>
<if test="slaveJobCode != null">
and expand.slave_job_code = #{slaveJobCode}
</if>
</select>
<insert id="insertDriverSchedulingExpand" parameterType="DriverSchedulingExpand" useGeneratedKeys="true" keyProperty="id">
insert into driver_scheduling_expand
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="status != null">status,</if>
<if test="masterJobCode != null">master_job_code,</if>
<if test="slaveJobCode != null">slave_job_code,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="status != null">#{status},</if>
<if test="masterJobCode != null">#{masterJobCode},</if>
<if test="slaveJobCode != null">#{slaveJobCode},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateDriverSchedulingExpand" parameterType="DriverSchedulingExpand">
update driver_scheduling_expand
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
<if test="masterJobCode != null">master_job_code = #{masterJobCode},</if>
<if test="slaveJobCode != null">slave_job_code = #{slaveJobCode},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="type != null">`type` = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDriverSchedulingExpandById" parameterType="Long">
delete from driver_scheduling_expand where id = #{id}
</delete>
<delete id="deleteDriverSchedulingExpandByIds" parameterType="String">
delete from driver_scheduling_expand where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>