MerchantLevelMapper.xml
3.96 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.dj.system.mapper.MerchantLevelMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.system.model.MerchantLevel" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="user_type" property="userType" jdbcType="TINYINT" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="city_merchant_id" property="cityMerchantId" jdbcType="INTEGER" />
<result column="city_merchant_name" property="cityMerchantName" jdbcType="VARCHAR" />
<result column="province_merchant_id" property="provinceMerchantId" jdbcType="INTEGER" />
<result column="province_merchant_name" property="provinceMerchantName" jdbcType="VARCHAR" />
<result column="factory_merchant_id" property="factoryMerchantId" jdbcType="INTEGER" />
<result column="factory_merchant_name" property="factoryMerchantName" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, user_id, user_type, merchant_id, merchant_name, city_merchant_id, city_merchant_name,
province_merchant_id, province_merchant_name, factory_merchant_id, factory_merchant_name,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="listMerchantIds" parameterType="cn.com.glsx.dj.system.model.MerchantLevel" resultType="java.lang.Integer">
select merchant_id from dj_system_merchant_level
<where>
deleted_flag='N'
<if test="factoryMerchantId != null">
and factory_merchant_id = #{factoryMerchantId}
</if>
<if test="provinceMerchantId != null">
and province_merchant_id = #{provinceMerchantId}
</if>
<if test="cityMerchantId != null">
and city_merchant_id = #{cityMerchantId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</where>
</select>
<select id="listMerchant" parameterType="cn.com.glsx.dj.system.model.MerchantLevel" resultMap="BaseResultMap">
select user_type,merchant_id,merchant_name from dj_system_merchant_level
<where>
deleted_flag='N'
<if test="factoryMerchantId != null">
and factory_merchant_id = #{factoryMerchantId}
</if>
<if test="provinceMerchantId != null">
and province_merchant_id = #{provinceMerchantId}
</if>
<if test="cityMerchantId != null">
and city_merchant_id = #{cityMerchantId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="userType != null">
and user_type = #{userType}
</if>
</where>
</select>
<select id="listSelfMerchantId" parameterType="cn.com.glsx.dj.system.model.MerchantLevel" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from dj_system_merchant_level
<where>
deleted_flag='N'
<if test="factoryMerchantId != null">
and factory_merchant_id = #{factoryMerchantId}
</if>
<if test="provinceMerchantId != null">
and province_merchant_id = #{provinceMerchantId}
</if>
<if test="cityMerchantId != null">
and city_merchant_id = #{cityMerchantId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="userType != null">
and user_type = #{userType}
</if>
</where>
</select>
</mapper>