SysOpAdviceSMapper.xml
5.13 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
<?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.zteits.sys.mapper.smapper.SysOpAdviceSMapper">
<resultMap id="BaseResultMap" type="com.zteits.sys.domain.SysOpAdvice">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="op_id" jdbcType="BIGINT" property="opId"/>
<result column="advice_type" jdbcType="INTEGER" property="adviceType"/>
<result column="advice" jdbcType="VARCHAR" property="advice"/>
<result column="read_state" jdbcType="INTEGER" property="readState"/>
<result column="create_empid" jdbcType="VARCHAR" property="createEmpid"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid"/>
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, op_id, advice_type, advice, read_state, create_empid, create_date, modfiy_empid,
modfiy_date, remark
</sql>
<insert id="batchSaveSysOpAdvice" parameterType="java.util.List">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_op_advice (op_id, advice_type, advice,
read_state, create_empid, create_date,
modfiy_empid, modfiy_date, remark
)
values
<foreach collection="adviceList" item="advice" separator=",">
(#{advice.opId,jdbcType=BIGINT}, #{advice.adviceType,jdbcType=INTEGER}, #{advice.advice,jdbcType=VARCHAR},
#{advice.readState,jdbcType=INTEGER}, #{advice.createEmpid,jdbcType=VARCHAR},
#{advice.createDate,jdbcType=TIMESTAMP},
#{advice.modfiyEmpid,jdbcType=VARCHAR}, #{advice.modfiyDate,jdbcType=TIMESTAMP},
#{advice.remark,jdbcType=VARCHAR}
)
</foreach>
</insert>
</mapper>