linwe
2024-05-29 c10d6358b9f014375a13821465bc978d0c0da22e
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
<?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="org.springblade.modules.category.mapper.CategoryLabelMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="categoryLabelResultMap" type="org.springblade.modules.category.entity.CategoryLabelEntity">
        <result column="id" property="id"/>
        <result column="category_no" property="categoryNo"/>
        <result column="category_name" property="categoryName"/>
        <result column="label" property="label"/>
        <result column="remark" property="remark"/>
    </resultMap>
 
    <resultMap type="org.springblade.modules.category.dto.CategoryLabelDTO" id="CategoryLabelDTOResult">
        <result property="id"    column="id"    />
        <result property="categoryNo"    column="category_no"    />
        <result property="categoryName"    column="category_name"    />
        <result property="label"    column="label"    />
        <result property="remark"    column="remark"    />
    </resultMap>
 
    <sql id="selectCategoryLabel">
        select
            id,
            category_no,
            category_name,
            label,
            remark
        from
            jczz_category_label
    </sql>
 
 
    <select id="selectCategoryLabelById" parameterType="int" resultMap="CategoryLabelDTOResult">
        <include refid="selectCategoryLabel"/>
        where
        id = #{id}
    </select>
 
 
    <select id="selectCategoryLabelPage" resultMap="categoryLabelResultMap">
        select * from jczz_category_label where is_deleted = 0
    </select>
 
    <select id="selectCategoryLabelList" parameterType="org.springblade.modules.category.dto.CategoryLabelDTO" resultMap="CategoryLabelDTOResult">
        select
        jcl.id,
        jcl.category_no,
        jcl.category_name,
        jcl.label,
        jcl.remark
        from
        jczz_place_poi_label jppl LEFT JOIN jczz_category_label jcl on jcl.category_no=jppl.poi_code
        <where>
            <if test="id != null "> and jcl.id = #{id}</if>
            <if test="placeId != null and placeId != '' "> and jppl.place_id = #{placeId}</if>
            <if test="categoryNo != null  and categoryNo != ''"> and jcl.category_no = #{categoryNo}</if>
            <if test="categoryName != null  and categoryName != ''"> and cjcl.ategory_name = #{categoryName}</if>
            <if test="label != null  and label != ''"> and jcl.label = #{label}</if>
            <if test="remark != null  and remark != ''"> and jcl.remark = #{remark}</if>
            and jcl.category_no is not null
        </where>
    </select>
 
 
</mapper>