zxl
3 天以前 b76f0174ce81d7639bf33cc10e67cb6b9e85de3f
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
<?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.lili.modules.lmk.mapper.TagMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.TagVO">
        <id column="id" property="id"/>
        <result column="tag_type_id" property="tagTypeId"/>
        <result column="tag_type_name" property="tagTypeName"/>
        <result column="tag_name" property="tagName"/>
        <result column="sort_num" property="sortNum"/>
 
    </resultMap>
    <select id="getPage" resultMap="BaseResultMap">
        select t.id,t.tag_type_id,t.tag_name,t.sort_num,tt.tag_type_name as tag_type_name
        from lmk_tag t
        left join lmk_tag_type tt on t.tag_type_id = tt.id
        where t.delete_flag = false
        <if test="query.tagName != null and query.tagName  != ''">
            and t.tag_name like concat('%',#{query.tagName},'%')
        </if>
        <if test="query.tagTypeId != null and query.tagTypeId  != ''">
            and t.tag_type_id = #{query.tagTypeId}
        </if>
        <if test="query.tagTypeKey != null and query.tagTypeKey  != ''">
            and tt.type_key = #{query.tagTypeKey}
        </if>
        order by t.sort_num
    </select>
 
</mapper>