LinggangKeyWorkLocationMapper.xml
8.43 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
<?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.key.location.LinggangKeyWorkLocationMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.key.location.LinggangKeyWorkLocation">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="yard_Id" jdbcType="INTEGER" property="yardId"/>
<result column="yard_Name" jdbcType="VARCHAR" property="yardName"/>
<result column="device" jdbcType="VARCHAR" property="device"/>
<result column="cabinet_No" jdbcType="VARCHAR" property="cabinetNo"/>
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="BIGINT" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="del_flag" jdbcType="BIT" property="delFlag"/>
<result column="event_Type" jdbcType="INTEGER" property="eventType"/>
<result column="key_info_id" jdbcType="INTEGER" property="keyInfoId"/>
<result column="schedule_date" jdbcType="TIMESTAMP" property="scheduleDate"/>
<result column="scheduling_id" jdbcType="VARCHAR" property="schedulingId"/>
</resultMap>
<insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
parameterType="com.ruoyi.domain.key.location.LinggangKeyWorkLocation">
INSERT INTO key_work_location
<include refid="insertSelectiveColumn"></include>
<include refid="insertSelectiveValue"></include>
</insert>
<select id="listOfDeviceKeyIdScheduleDate" resultMap="BaseResultMap">
select <include refid="columns"></include> from key_work_location
where del_flag = 0 and(
<foreach collection="localtions" item="item" separator="or" open="(" close=")">
device=#{item.device} and key_info_id=#{item.keyInfoId} and schedule_date=#{item.scheduleDate}
</foreach>
)
</select>
<select id="listRecent" resultMap="BaseResultMap">
select <include refid="columns"></include> from key_work_location
where 1=1 and
<foreach collection="localtions" open="(" close=")" separator="or " item="item">
<include refid="where"></include>
</foreach>
</select>
<select id="listRecentDates" resultType="com.ruoyi.domain.key.location.LinggangKeyWorkLocation">
select <include refid="columns"></include> from key_work_location
where 1=1
<if test="null != keyInfoIds">
and key_info_id in
<foreach collection="keyInfoIds" item="item" separator="," open="(" close=")">#{item}</foreach>
</if>
<if test="null!=dates">
and (
<foreach collection="dates" item="item" separator="or " open="(" close=")">
schedule_date between #{item.startDate} and #{item.endDate}
</foreach>
)
</if>
</select>
<sql id="columns">
id
, yard_Id , yard_Name , device , cabinet_No , create_by , create_time , update_by , update_time , del_flag , event_Type , key_info_id , schedule_date , scheduling_id
</sql>
<sql id="insert_columns">
id
, yard_Id , yard_Name , device , cabinet_No , create_by , create_time , update_by , update_time , del_flag , event_Type , key_info_id , schedule_date , scheduling_id
</sql>
<sql id="insert_values">
#{id}
,
#{yardId},
#{yardName},
#{device},
#{cabinetNo},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{delFlag},
#{eventType},
#{keyInfoId},
#{scheduleDate},
#{schedulingId}
</sql>
<sql id="insertSelectiveColumn">
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null!=id">id,</if>
<if test="null!=yardId">yard_Id,</if>
<if test="null!=yardName">yard_Name,</if>
<if test="null!=device">device,</if>
<if test="null!=cabinetNo">cabinet_No,</if>
<if test="null!=createBy">create_by,</if>
<if test="null!=createTime">create_time,</if>
<if test="null!=updateBy">update_by,</if>
<if test="null!=updateTime">update_time,</if>
<if test="null!=delFlag">del_flag,</if>
<if test="null!=eventType">event_Type,</if>
<if test="null!=keyInfoId">key_info_id,</if>
<if test="null!=scheduleDate">schedule_date,</if>
<if test="null!=schedulingId">scheduling_id,</if>
</trim>
</sql>
<sql id="insertSelectiveValue">
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null!=id">#{id,jdbcType=BIGINT},</if>
<if test="null!=yardId">#{yardId,jdbcType=INTEGER},</if>
<if test="null!=yardName">#{yardName,jdbcType=VARCHAR},</if>
<if test="null!=device">#{device,jdbcType=VARCHAR},</if>
<if test="null!=cabinetNo">#{cabinetNo,jdbcType=VARCHAR},</if>
<if test="null!=createBy">#{createBy,jdbcType=BIGINT},</if>
<if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if>
<if test="null!=updateBy">#{updateBy,jdbcType=BIGINT},</if>
<if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
<if test="null!=delFlag">#{delFlag,jdbcType=BIT},</if>
<if test="null!=eventType">#{eventType,jdbcType=INTEGER},</if>
<if test="null!=keyInfoId">#{keyInfoId,jdbcType=INTEGER},</if>
<if test="null!=scheduleDate">#{scheduleDate,jdbcType=TIMESTAMP},</if>
<if test="null!=schedulingId">#{schedulingId,jdbcType=VARCHAR},</if>
</trim>
</sql>
<sql id="updateByPrimaryKeySelectiveSql">
<set>
<if test="null!=id">id = #{id,jdbcType=BIGINT},</if>
<if test="null!=yardId">yard_Id = #{yardId,jdbcType=INTEGER},</if>
<if test="null!=yardName">yard_Name = #{yardName,jdbcType=VARCHAR},</if>
<if test="null!=device">device = #{device,jdbcType=VARCHAR},</if>
<if test="null!=cabinetNo">cabinet_No = #{cabinetNo,jdbcType=VARCHAR},</if>
<if test="null!=createBy">create_by = #{createBy,jdbcType=BIGINT},</if>
<if test="null!=createTime">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
<if test="null!=updateBy">update_by = #{updateBy,jdbcType=BIGINT},</if>
<if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
<if test="null!=delFlag">del_flag = #{delFlag,jdbcType=BIT},</if>
<if test="null!=eventType">event_Type = #{eventType,jdbcType=INTEGER},</if>
<if test="null!=keyInfoId">key_info_id = #{keyInfoId,jdbcType=INTEGER},</if>
<if test="null!=scheduleDate">schedule_date = #{scheduleDate,jdbcType=TIMESTAMP},</if>
<if test="null!=schedulingId">scheduling_id = #{schedulingId,jdbcType=VARCHAR},</if>
</set>
</sql>
<sql id="where">
<if test="null!=id">AND id = #{id,jdbcType=BIGINT},</if>
<if test="null!=yardId">AND yard_Id = #{yardId,jdbcType=INTEGER},</if>
<if test="null!=yardName">AND yard_Name = #{yardName,jdbcType=VARCHAR},</if>
<if test="null!=device">AND device = #{device,jdbcType=VARCHAR},</if>
<if test="null!=cabinetNo">AND cabinet_No = #{cabinetNo,jdbcType=VARCHAR},</if>
<if test="null!=createBy">AND create_by = #{createBy,jdbcType=BIGINT},</if>
<if test="null!=createTime">AND create_time = #{createTime,jdbcType=TIMESTAMP},</if>
<if test="null!=updateBy">AND update_by = #{updateBy,jdbcType=BIGINT},</if>
<if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
<if test="null!=delFlag">AND del_flag = #{delFlag,jdbcType=BIT},</if>
<if test="null!=eventType">AND event_Type = #{eventType,jdbcType=INTEGER},</if>
<if test="null!=keyInfoId">AND key_info_id = #{keyInfoId,jdbcType=INTEGER},</if>
<if test="null!=scheduleDate">AND schedule_date = #{scheduleDate,jdbcType=TIMESTAMP},</if>
<if test="null!=schedulingId">AND scheduling_id = #{schedulingId,jdbcType=VARCHAR},</if>
</sql>
</mapper>