LinggangSchedulingMapper.xml
11.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?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.mapper.scheduling.LinggangSchedulingMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.scheduling.LinggangScheduling">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="schedule_date" jdbcType="DATE" property="scheduleDate"/>
<result column="line_name" jdbcType="VARCHAR" property="lineName"/>
<result column="job_code" jdbcType="VARCHAR" property="jobCode"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="posts" jdbcType="VARCHAR" property="posts"/>
<result column="lp_name" jdbcType="VARCHAR" property="lpName"/>
<result column="nbbm" jdbcType="VARCHAR" property="nbbm"/>
<result column="bc_type" jdbcType="VARCHAR" property="bcType"/>
<result column="fcsj_t" jdbcType="BIGINT" property="fcsjT"/>
<result column="zdsj_t" jdbcType="BIGINT" property="zdsjT"/>
<result column="sign_in_id" jdbcType="INTEGER" property="signInId"/>
<result column="ex_type" jdbcType="TINYINT" property="exType"/>
<result column="sign_time" jdbcType="TIMESTAMP" property="signTime"/>
<result column="sign_type" jdbcType="TINYINT" property="signType"/>
<result column="alcohol_flag" jdbcType="TINYINT" property="alcoholFlag"/>
<result column="alcohol_intake" jdbcType="DECIMAL" property="alcoholIntake"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="key_info_id" jdbcType="INTEGER" property="keyInfoId"/>
<result column="upDown" jdbcType="INTEGER" property="updown" />
<result column="qdzCode" jdbcType="VARCHAR" property="qdzcode" />
<result column="qdzName" jdbcType="VARCHAR" property="qdzname" />
<result column="zdzCode" jdbcType="VARCHAR" property="zdzcode" />
<result column="zdzName" jdbcType="VARCHAR" property="zdzname" />
</resultMap>
<insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
parameterType="com.ruoyi.domain.scheduling.LinggangScheduling">
INSERT INTO scheduling
<include refid="insertSelectiveColumn"></include>
<include refid="insertSelectiveValue"></include>
</insert>
<select id="listByCZ" resultMap="BaseResultMap">
select <include refid="columns"></include> from scheduling
<where>
<include refid="where"></include>
<if test="null != czCode">and (qdzcode = #{czCode} OR zdzcode = #{czCode})</if>
<choose>
<when test="null !=startScheduleDate and null !=endScheduleDate">and schedule_date BETWEEN
#{startScheduleDate} and #{endScheduleDate}
</when>
<when test="null !=startScheduleDate">and schedule_date >= #{startScheduleDate}</when>
<when test="null !=endScheduleDate">and schedule_date <= #{endScheduleDate}</when>
</choose>
</where>
</select>
<select id="listNbbmByEntity" resultType="java.lang.String">
select nbbm
from scheduling
WHERE scheduling_type = #{type} and (qdzcode = #{czCode} OR zdzcode = #{czCode}) and schedule_date BETWEEN #{startScheduleDate} and #{endScheduleDate}
group by nbbm
</select>
<sql id="columns">
id , schedule_date , line_name , job_code , name , posts , lp_name , nbbm , bc_type , fcsj_t , zdsj_t , sign_in_id , ex_type , sign_time , sign_type , alcohol_flag , alcohol_intake , remark , key_info_id , upDown , qdzCode , qdzName , zdzCode , zdzName
</sql>
<sql id="insert_columns">
id , schedule_date , line_name , job_code , name , posts , lp_name , nbbm , bc_type , fcsj_t , zdsj_t , sign_in_id , ex_type , sign_time , sign_type , alcohol_flag , alcohol_intake , remark , key_info_id , upDown , qdzCode , qdzName , zdzCode , zdzName
</sql>
<sql id="insert_values">
#{id}, #{scheduleDate}, #{lineName}, #{jobCode}, #{name}, #{posts}, #{lpName}, #{nbbm}, #{bcType}, #{fcsjT}, #{zdsjT}, #{signInId}, #{exType}, #{signTime}, #{signType}, #{alcoholFlag}, #{alcoholIntake}, #{remark}, #{keyInfoId}, #{updown}, #{qdzcode}, #{qdzname}, #{zdzcode}, #{zdzname}
</sql>
<sql id="insertSelectiveColumn">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null!=id">id,</if>
<if test="null!=scheduleDate">schedule_date,</if>
<if test="null!=lineName">line_name,</if>
<if test="null!=jobCode">job_code,</if>
<if test="null!=name">name,</if>
<if test="null!=posts">posts,</if>
<if test="null!=lpName">lp_name,</if>
<if test="null!=nbbm">nbbm,</if>
<if test="null!=bcType">bc_type,</if>
<if test="null!=fcsjT">fcsj_t,</if>
<if test="null!=zdsjT">zdsj_t,</if>
<if test="null!=signInId">sign_in_id,</if>
<if test="null!=exType">ex_type,</if>
<if test="null!=signTime">sign_time,</if>
<if test="null!=signType">sign_type,</if>
<if test="null!=alcoholFlag">alcohol_flag,</if>
<if test="null!=alcoholIntake">alcohol_intake,</if>
<if test="null!=remark">remark,</if>
<if test="null!=keyInfoId">key_info_id,</if>
<if test="null!=updown">upDown,</if>
<if test="null!=qdzcode">qdzCode,</if>
<if test="null!=qdzname">qdzName,</if>
<if test="null!=zdzcode">zdzCode,</if>
<if test="null!=zdzname">zdzName,</if>
</trim>
</sql>
<sql id="insertSelectiveValue">
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null!=id">#{id,jdbcType=INTEGER},</if>
<if test="null!=scheduleDate">#{scheduleDate,jdbcType=DATE},</if>
<if test="null!=lineName">#{lineName,jdbcType=VARCHAR},</if>
<if test="null!=jobCode">#{jobCode,jdbcType=VARCHAR},</if>
<if test="null!=name">#{name,jdbcType=VARCHAR},</if>
<if test="null!=posts">#{posts,jdbcType=VARCHAR},</if>
<if test="null!=lpName">#{lpName,jdbcType=VARCHAR},</if>
<if test="null!=nbbm">#{nbbm,jdbcType=VARCHAR},</if>
<if test="null!=bcType">#{bcType,jdbcType=VARCHAR},</if>
<if test="null!=fcsjT">#{fcsjT,jdbcType=BIGINT},</if>
<if test="null!=zdsjT">#{zdsjT,jdbcType=BIGINT},</if>
<if test="null!=signInId">#{signInId,jdbcType=INTEGER},</if>
<if test="null!=exType">#{exType,jdbcType=TINYINT},</if>
<if test="null!=signTime">#{signTime,jdbcType=TIMESTAMP},</if>
<if test="null!=signType">#{signType,jdbcType=TINYINT},</if>
<if test="null!=alcoholFlag">#{alcoholFlag,jdbcType=TINYINT},</if>
<if test="null!=alcoholIntake">#{alcoholIntake,jdbcType=DECIMAL},</if>
<if test="null!=remark">#{remark,jdbcType=VARCHAR},</if>
<if test="null!=keyInfoId">#{keyInfoId,jdbcType=INTEGER},</if>
<if test="null!=updown">#{updown,jdbcType=INTEGER},</if>
<if test="null!=qdzcode">#{qdzcode,jdbcType=VARCHAR},</if>
<if test="null!=qdzname">#{qdzname,jdbcType=VARCHAR},</if>
<if test="null!=zdzcode">#{zdzcode,jdbcType=VARCHAR},</if>
<if test="null!=zdzname">#{zdzname,jdbcType=VARCHAR},</if>
</trim>
</sql>
<sql id="updateByPrimaryKeySelectiveSql">
<set>
<if test="null!=id"> id = #{id,jdbcType=INTEGER},</if>
<if test="null!=scheduleDate"> schedule_date = #{scheduleDate,jdbcType=DATE},</if>
<if test="null!=lineName"> line_name = #{lineName,jdbcType=VARCHAR},</if>
<if test="null!=jobCode"> job_code = #{jobCode,jdbcType=VARCHAR},</if>
<if test="null!=name"> name = #{name,jdbcType=VARCHAR},</if>
<if test="null!=posts"> posts = #{posts,jdbcType=VARCHAR},</if>
<if test="null!=lpName"> lp_name = #{lpName,jdbcType=VARCHAR},</if>
<if test="null!=nbbm"> nbbm = #{nbbm,jdbcType=VARCHAR},</if>
<if test="null!=bcType"> bc_type = #{bcType,jdbcType=VARCHAR},</if>
<if test="null!=fcsjT"> fcsj_t = #{fcsjT,jdbcType=BIGINT},</if>
<if test="null!=zdsjT"> zdsj_t = #{zdsjT,jdbcType=BIGINT},</if>
<if test="null!=signInId"> sign_in_id = #{signInId,jdbcType=INTEGER},</if>
<if test="null!=exType"> ex_type = #{exType,jdbcType=TINYINT},</if>
<if test="null!=signTime"> sign_time = #{signTime,jdbcType=TIMESTAMP},</if>
<if test="null!=signType"> sign_type = #{signType,jdbcType=TINYINT},</if>
<if test="null!=alcoholFlag"> alcohol_flag = #{alcoholFlag,jdbcType=TINYINT},</if>
<if test="null!=alcoholIntake"> alcohol_intake = #{alcoholIntake,jdbcType=DECIMAL},</if>
<if test="null!=remark"> remark = #{remark,jdbcType=VARCHAR},</if>
<if test="null!=keyInfoId"> key_info_id = #{keyInfoId,jdbcType=INTEGER},</if>
<if test="null!=updown"> upDown = #{updown,jdbcType=INTEGER},</if>
<if test="null!=qdzcode"> qdzCode = #{qdzcode,jdbcType=VARCHAR},</if>
<if test="null!=qdzname"> qdzName = #{qdzname,jdbcType=VARCHAR},</if>
<if test="null!=zdzcode"> zdzCode = #{zdzcode,jdbcType=VARCHAR},</if>
<if test="null!=zdzname"> zdzName = #{zdzname,jdbcType=VARCHAR},</if>
</set>
</sql>
<sql id="where">
<if test="null!=id">AND id = #{id,jdbcType=INTEGER}, </if>
<if test="null!=scheduleDate">AND schedule_date = #{scheduleDate,jdbcType=DATE}, </if>
<if test="null!=lineName">AND line_name = #{lineName,jdbcType=VARCHAR}, </if>
<if test="null!=jobCode">AND job_code = #{jobCode,jdbcType=VARCHAR}, </if>
<if test="null!=name">AND name = #{name,jdbcType=VARCHAR}, </if>
<if test="null!=posts">AND posts = #{posts,jdbcType=VARCHAR}, </if>
<if test="null!=lpName">AND lp_name = #{lpName,jdbcType=VARCHAR}, </if>
<if test="null!=nbbm">AND nbbm = #{nbbm,jdbcType=VARCHAR}, </if>
<if test="null!=bcType">AND bc_type = #{bcType,jdbcType=VARCHAR}, </if>
<if test="null!=fcsjT">AND fcsj_t = #{fcsjT,jdbcType=BIGINT}, </if>
<if test="null!=zdsjT">AND zdsj_t = #{zdsjT,jdbcType=BIGINT}, </if>
<if test="null!=signInId">AND sign_in_id = #{signInId,jdbcType=INTEGER}, </if>
<if test="null!=exType">AND ex_type = #{exType,jdbcType=TINYINT}, </if>
<if test="null!=signTime">AND sign_time = #{signTime,jdbcType=TIMESTAMP}, </if>
<if test="null!=signType">AND sign_type = #{signType,jdbcType=TINYINT}, </if>
<if test="null!=alcoholFlag">AND alcohol_flag = #{alcoholFlag,jdbcType=TINYINT}, </if>
<if test="null!=alcoholIntake">AND alcohol_intake = #{alcoholIntake,jdbcType=DECIMAL}, </if>
<if test="null!=remark">AND remark = #{remark,jdbcType=VARCHAR}, </if>
<if test="null!=keyInfoId">AND key_info_id = #{keyInfoId,jdbcType=INTEGER}, </if>
<if test="null!=updown">AND upDown = #{updown,jdbcType=INTEGER}, </if>
<if test="null!=qdzcode">AND qdzCode = #{qdzcode,jdbcType=VARCHAR}, </if>
<if test="null!=qdzname">AND qdzName = #{qdzname,jdbcType=VARCHAR}, </if>
<if test="null!=zdzcode">AND zdzCode = #{zdzcode,jdbcType=VARCHAR}, </if>
<if test="null!=zdzname">AND zdzName = #{zdzname,jdbcType=VARCHAR}, </if>
<if test="null!=type">AND scheduling_type = #{type} </if>
</sql>
</mapper>