DracChannelCodeBillMapper.xml
4.22 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
<?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.com.glsx.entmicro.mapper.DracChannelCodeBillMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.DracChannelCodeBill">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code_id" jdbcType="INTEGER" property="codeId"/>
<result column="back_url" jdbcType="VARCHAR" property="backUrl"/>
<result column="auto_url" jdbcType="VARCHAR" property="autoUrl"/>
<result column="image_position" jdbcType="VARCHAR" property="imagePosition"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<!-- <result column="merchant_id" jdbcType="INTEGER" property="merchantId" />-->
<result column="thumbnail_url" jdbcType="VARCHAR" property="thumbnailUrl"/>
</resultMap>
<resultMap id="resultMap" type="cn.com.glsx.entmicro.model.response.DracChannelCodeBillListResponse">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="auto_url" jdbcType="VARCHAR" property="autoUrl"/>
<result column="back_url" jdbcType="VARCHAR" property="backUrl"/>
<result column="code_id" jdbcType="VARCHAR" property="codeId"/>
<result column="qr_code" jdbcType="VARCHAR" property="codeUrl"/>
<result column="image_position" jdbcType="VARCHAR" property="imagePosition"/>
<result column="code_state" jdbcType="VARCHAR" property="codeState"/>
<result column="thumbnail_url" jdbcType="VARCHAR" property="thumbnailUrl"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, code_id, channel_remark, auto_add, tagging, created_by, created_time, updated_by,
updated_time, del_flag, merchant_id, thumbnail_url
</sql>
<update id="deleteChannelCodeBill">
update drac_channel_code_bill
set del_flag = -1,
updated_time = NOW()
where
<trim prefixOverrides="and">
<if test="dracChannelCodeBillRequest.id != null">
id = #{dracChannelCodeBillRequest.id}
</if>
<if test="dracChannelCodeBillRequest.codeId != null">
and code_id = #{dracChannelCodeBillRequest.codeId}
</if>
</trim>
</update>
<!--当前活码海报活码列表-->
<select id="getSubCodeChannelCodeBill" resultMap="resultMap">
select t1.id,
t1.code_id,
t1.auto_url,
t1.back_url,
t2.qr_code,
t1.image_position,
t1.created_time,
t1.thumbnail_url
from drac_channel_code_bill t1
left join drac_channel_code t2 on t1.code_id = t2.id
where t1.del_flag = 0
and t1.code_id = #{codeId}
</select>
<!--获取所有海报活码-->
<select id="listChannelCodeBill" resultMap="resultMap">
select t1.id,
t1.back_url,
t1.auto_url,
t1.code_id,
t2.code_state,
t1.thumbnail_url
from drac_channel_code_bill t1
left join drac_channel_code t2 on t1.code_id = t2.id
where t1.del_flag = 0
and t1.merchant_id = #{merchantId}
order by t1.created_time desc
</select>
<!--海报活码编辑详情-->
<select id="getChannelCodeBill" resultMap="resultMap">
select t1.id,
t1.code_id,
t1.auto_url,
t1.back_url,
t2.qr_code,
t1.image_position,
t1.thumbnail_url
from drac_channel_code_bill t1
left join drac_channel_code t2 on t1.code_id = t2.id
where t1.del_flag = 0
and t1.id = #{id}
</select>
</mapper>