WorkMapper.xml
2.21 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
<?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.WorkMapper">
<insert id="insert" parameterType="com.ruoyi.service.domain.Work">
insert into work(
<if test="userId != null and userId != ''">userId,</if>
<if test="message != null and message != ''">message,</if>
<if test="workType != null and workType != ''">workType,</if>
<if test="applicant != null and applicant != ''">applicant,</if>
<if test="dept != null and dept != ''">dept,</if>
<if test="workState != null and workState != ''">workState,</if>
<if test="no != null and no != ''">no,</if>
<if test="name != null and name != ''">name,</if>
<if test="purpose != null and purpose != ''">purpose,</if>
<if test="way != null and way != ''">way,</if>
createTime
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="message != null and message != ''">#{message},</if>
<if test="workType != null and workType != ''">#{workType},</if>
<if test="applicant != null and applicant != ''">#{applicant},</if>
<if test="dept != null and dept != ''">#{dept},</if>
<if test="workState != null and workState != ''">#{workState},</if>
<if test="no != null and no != ''">#{no},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="way != null and way != ''">#{way},</if>
sysdate()
)
</insert>
<select id="selectList" resultType="com.ruoyi.service.domain.Work" parameterType="com.ruoyi.service.domain.Work">
select * from work
where userId =#{userId}
<if test="workType != null and workType != 0">
AND workType =#{workType}
</if>
<if test="workState != null and workState != 0">
AND workState =#{workState}
</if>
</select>
<update id="update" parameterType="com.ruoyi.service.domain.Work">
update work
<set>
<if test="workState != null and workState != ''">workState = #{workState},</if>
<if test="examineType != null and examineType != ''">examineType = #{examineType},</if>
<if test="mark != null">mark = #{mark},</if>
updateTime = sysdate()
</set>
where id = #{id}
</update>
</mapper>