linwe
2023-11-29 59e1a8ff7dfd9af5244ae5448d8af745a9720d13
src/main/java/org/springblade/modules/category/mapper/CategoryLabelMapper.xml
@@ -11,10 +11,55 @@
        <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>
        </where>
    </select>
</mapper>