GroupOneTemplateMapper.xml
3.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
<?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.GroupOneTemplateMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.GroupOneTemplate">
<!--@Table scrm_group_one_template-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
<result column="group_name_rule" jdbcType="INTEGER" property="groupNameRule" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
<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="TINYINT" property="delFlag" />
</resultMap>
<resultMap id="ResultMap" type="cn.com.glsx.entmicro.model.response.GroupOneTemplateResponse"
extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List">
id, org_name, group_name,group_name_rule, `status`, merchant_id, uuid, created_by, created_time, updated_by,
updated_time, del_flag
</sql>
<!--<update id="updateByPrimaryKey" parameterType="cn.com.glsx.entmicro.entity.GroupOneTemplate">
update scrm_group_one_template
set org_name = #{orgName,jdbcType=VARCHAR},
group_name = #{groupName,jdbcType=VARCHAR},
welcome = #{welcome,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
created_by = #{createdBy,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=INTEGER},
updated_time = #{updatedTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>-->
<select id="selectByCondition" resultMap="ResultMap" parameterType="cn.com.glsx.entmicro.model.request.GroupOneTemplateSearchRequest">
select <include refid="Base_Column_List" /> from scrm_group_one_template
where 1 = 1
and merchant_id=#{obj.merchantId,jdbcType=VARCHAR}
<if test="obj.groupName != null and obj.groupName != ''">
and group_name like CONCAT('%',#{obj.groupName,jdbcType=VARCHAR},'%')
</if>
<if test="obj.status != null and obj.status != ''">
and status=#{obj.status,jdbcType=TINYINT}
</if>
order by created_time desc
</select>
<select id="getOneTemplateListByName" resultMap="ResultMap" parameterType="cn.com.glsx.entmicro.model.request.GroupOneTemplateSearchRequest">
select <include refid="Base_Column_List" /> from scrm_group_one_template
where merchant_id=#{nameValid.merchantId,jdbcType=VARCHAR}
<if test="nameValid.templateName!=null and nameValid.templateName!=''">
and group_name=#{nameValid.templateName, jdbcType=VARCHAR}
</if>
and del_flag = 0
order by created_time desc
</select>
</mapper>