EntmicroAuthorizeMapper.xml
4.18 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
<?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.EntmicroAuthorizeMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.EntmicroAuthorize">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="merchant_id" jdbcType="INTEGER" property="merchantId"/>
<result column="entmicro_name" jdbcType="VARCHAR" property="entmicroName"/>
<result column="entmicro_id" jdbcType="VARCHAR" property="entmicroId"/>
<result column="entid_bef_encryption" jdbcType="VARCHAR" property="entidBefEncryption"/>
<result column="access_scrm_flag" jdbcType="VARCHAR" property="accessScrmFlag"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, merchant_id, entmicro_name, entmicro_id
</sql>
<select id="findEntmicroId" resultType="java.lang.String">
SELECT entmicro_id FROM entmicro_authorize WHERE merchant_id=#{merchantNo}
GROUP BY merchant_id
</select>
<select id="findEntmicroName" resultType="java.lang.String">
SELECT entmicro_name FROM entmicro_authorize WHERE merchant_id=#{merchantNo}
GROUP BY merchant_id
</select>
<select id="findAllAuthMerchant" resultType="java.lang.Integer">
SELECT merchant_id FROM entmicro_authorize group by merchant_id
</select>
<select id="selectEntmicroAuthorizeByMerchantName" resultMap="BaseResultMap">
SELECT ea.merchant_id,ea.entmicro_name FROM entmicro_authorize ea
WHERE entid_bef_encryption is not null
<if test="merchantName != null and merchantName != ''">
and ea.entmicro_name like '%${merchantName}%'
</if>
<if test="excludeList != null and excludeList.size > 0">
and ea.merchant_id not in
<foreach collection="excludeList" index="index" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</if>
group by merchant_id
</select>
<select id="findByCondition" resultMap="BaseResultMap">
select * from entmicro_authorize
where
<choose>
<when test="loginCallBackModel.corpFullName != null and loginCallBackModel.corpFullName != ''">
entmicro_name=#{loginCallBackModel.corpFullName}
<if test="loginCallBackModel.corpShortName != null and loginCallBackModel.corpShortName != ''">
OR entmicro_name=#{loginCallBackModel.corpShortName}
</if>
</when>
<otherwise>
<if test="loginCallBackModel.corpShortName != null and loginCallBackModel.corpShortName != ''">
entmicro_name=#{loginCallBackModel.corpShortName}
</if>
</otherwise>
</choose>
</select>
<select id="findEntmicroEntmicroId" resultMap="BaseResultMap">
select * from entmicro_authorize
where merchant_id=#{merchantNo} limit 1
</select>
<select id="selectSubscribeMerchantPage"
resultType="cn.com.glsx.entmicro.model.response.subscribe.SubscribeMerchantResponse">
SELECT ea.merchant_id merchantId,ea.entmicro_name merchantName
FROM entmicro_authorize ea
left join scrm_subscribe_merchant ssm on ea.merchant_id = ssm.merchant_id and ssm.del_flag = 0
WHERE ssm.id is null
<if test="includeList != null and includeList.size > 0">
and ea.merchant_id in
<foreach collection="includeList" index="index" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</if>
<if test="excludeList != null and excludeList.size > 0">
and ea.merchant_id not in
<foreach collection="excludeList" index="index" open="(" close=")" separator="," item="id">
#{id}
</foreach>
</if>
<if test="selectMerchantId != null">
and ea.merchant_id = #{selectMerchantId}
</if>
group by ea.merchant_id
</select>
</mapper>