SafetyDetailMapper.xml
2.03 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
<?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.service.mapper.SafetyDetailMapper">
<insert id="insert" parameterType="com.ruoyi.service.domain.SafetyDetail">
insert into safety_detail(
<if test="safetyId != null and safetyId != ''">safetyId,</if>
<if test="checkType != null and checkType != ''">checkType,</if>
<if test="archivalCode != null and archivalCode != ''">archivalCode,</if>
<if test="title != null and title != ''">title,</if>
<if test="boxMark != null and boxMark != ''">boxMark,</if>
<if test="locationCode != null and locationCode != ''">locationCode,</if>
<if test="archivesState != null and archivesState != ''">archivesState,</if>
<if test="remedy != null and remedy != ''">remedy,</if>
createTime
)values(
<if test="safetyId != null and safetyId != ''">#{safetyId},</if>
<if test="checkType != null and checkType != ''">#{checkType},</if>
<if test="archivalCode != null and archivalCode != ''">#{archivalCode},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="boxMark != null and boxMark != ''">#{boxMark},</if>
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="archivesState != null and archivesState != ''">#{archivesState},</if>
<if test="remedy != null and remedy != ''">#{remedy},</if>
sysdate()
)
</insert>
<select id="selectList" resultType="com.ruoyi.service.domain.SafetyDetail" parameterType="com.ruoyi.service.domain.SafetyDetail">
select * from safety_detail
<where>
<if test="safetyId != null and safetyId != ''">
AND safetyId =#{safetyId}
</if>
<if test="checkType != null and checkType != ''">
AND checkType =#{checkType}
</if>
</where>
</select>
<select id="selectCountByCheckType" resultType="map" parameterType="com.ruoyi.service.domain.SafetyDetail">
SELECT count(*) count,checkType FROM `safety_detail`
where safetyId =#{safetyId}
GROUP BY checkType
</select>
</mapper>