xiangpei
9 小时以前 4f89ece90fca89b667a244376605f9190a234b80
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
<?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 like concat('%',#{query.tagTypeId},'%')
        </if>
        order by t.sort_num
    </select>
 
</mapper>