BosAssistantDetailMapper.xml
3.53 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
<?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.huaheng.pc.config.bosAssistantDetail.mapper.BosAssistantDetailMapper">
<resultMap type="com.huaheng.pc.config.bosAssistantDetail.domain.BosAssistantDetail" id="bosAssistantDetailResult">
<result property="entityId" jdbcType="INTEGER" column="entityId" />
<result property="id" column="id" />
<result property="number" column="number" />
<result property="dataValue" column="dataValue" />
<result property="documentStatus" column="documentStatus" />
<result property="isSysPreset" column="isSysPreset" />
<result property="description" column="description" />
</resultMap>
<sql id="selectBosAssistantDetailVo">
select entityId, id,number, dataValue, documentStatus,isSysPreset,description from bos_assistant_detail
</sql>
<select id="selectByNumber" resultType="com.huaheng.pc.config.bosAssistantDetail.domain.BosAssistantDetail">
<include refid="selectBosAssistantDetailVo"></include>
<where>
`number`=#{code} and id=#{id}
</where>
</select>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO bos_assistant_detail
(entityId,number,id,dataValue,documentStatus,isSysPreset,description) VALUES
<foreach collection="list" item="item" separator=",">
(#{item.entityId},#{item.number},#{item.id},#{item.dataValue},#{item.documentStatus},#{item.isSysPreset},#{item.description})
</foreach>
</insert>
<update id="modifyBatch" parameterType="java.util.List">
update bos_assistant_detail
<trim prefix="set" suffixOverrides=",">
<trim prefix="description =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.description!=null">
when entityId=#{item.entityId}
then #{item.description}
</if>
</foreach>
</trim>
<trim prefix="isSysPreset =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.isSysPreset!=null">
when entityId=#{item.entityId}
then #{item.isSysPreset}
</if>
</foreach>
</trim>
<trim prefix="dataValue =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.dataValue!=null">
when entityId=#{item.entityId}
then #{item.dataValue}
</if>
</foreach>
</trim>
<trim prefix="documentStatus =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.documentStatus!=null">
when entityId=#{item.entityId}
then #{item.documentStatus}
</if>
</foreach>
</trim>
</trim>
where entityId in
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.entityId}
</foreach>
</update>
<update id="truncateTable">
truncate table bos_assistant_detail
</update>
</mapper>