WxgzhSiteMapper.xml
3.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
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
<?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="cn.runsa.crmapp.common.mapper.WxgzhSiteMapper" >
<resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.WxgzhSite" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="GZH_ID" property="gzhId" jdbcType="VARCHAR" />
<result column="SIT_CODE" property="sitCode" jdbcType="VARCHAR" />
<result column="STAT" property="stat" jdbcType="TINYINT" />
<result column="QRCODE" property="qrcode" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
`GZH_ID`, `SIT_CODE`, `STAT`, `QRCODE`
</sql>
<insert id="insert" parameterType="cn.runsa.crmapp.common.entity.WxgzhSite" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into crm_wxgzh_site ("GZH_ID", "SIT_CODE", "STAT",
"QRCODE")
values (#{gzhId,jdbcType=VARCHAR}, #{sitCode,jdbcType=VARCHAR}, #{stat,jdbcType=TINYINT},
#{qrcode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.WxgzhSite" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into crm_wxgzh_site
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="gzhId != null" >
"GZH_ID",
</if>
<if test="sitCode != null" >
"SIT_CODE",
</if>
<if test="stat != null" >
"STAT",
</if>
<if test="qrcode != null" >
"QRCODE",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="gzhId != null" >
#{gzhId,jdbcType=VARCHAR},
</if>
<if test="sitCode != null" >
#{sitCode,jdbcType=VARCHAR},
</if>
<if test="stat != null" >
#{stat,jdbcType=TINYINT},
</if>
<if test="qrcode != null" >
#{qrcode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="getWxCodes" resultMap="BaseResultMap" parameterType="map">
SELECT
<include refid="Base_Column_List" />
FROM crm_wxgzh_site t WHERE t.GZH_ID = #{gzhId,jdbcType=VARCHAR} AND t.SIT_CODE in
<foreach collection="sitCodes" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="batchUpdateByGzhIdAndSitCode" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update crm_wxgzh_site t
<set>
t.QRCODE=${item.qrcode}
</set>
where t.GZH_ID = ${item.gzhId} and t.SIT_CODE = ${item.sitCode}
</foreach>
</update>
<insert id="batchInsertByGzhIdAndSitCode" parameterType="java.util.List">
insert into crm_wxgzh_site (GZH_ID, SIT_CODE, STAT, QRCODE) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.gzhId,jdbcType=VARCHAR}, #{item.sitCode,jdbcType=VARCHAR}, #{item.stat,jdbcType=TINYINT}, #{item.qrcode,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>