liujie
2025-06-09 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb
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
<?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="com.panzhihua.service_community.dao.ConvenientProductCategoryDAO">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ConvenientProductCategoryDO">
                <id column="id" property="id" />
                <id column="name" property="name" />
                <id column="merchant_id" property="merchantId" />
                <id column="remark" property="remark" />
                <id column="weight" property="weight" />
                <id column="is_del" property="isDel" />
                <id column="created_at" property="createdAt" />
                <id column="created_by" property="createdBy" />
                <id column="updated_at" property="updatedAt" />
                <id column="updated_by" property="updatedBy" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
    id,`name`,merchant_id,remark,weight,is_del,created_at,created_by,updated_at,updated_by
    </sql>
    <select id="pageProductCategory" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductCategoryVO">
        SELECT <include refid="Base_Column_List"/>
        FROM com_convenient_product_categories
        WHERE is_del = 0 AND merchant_id = #{pageConvenientProductCategoryDTO.merchantId}
        <if test="pageConvenientProductCategoryDTO.name != null and pageConvenientProductCategoryDTO.name.trim() != &quot;&quot;">
            AND `name` LIKE concat('%', #{pageConvenientProductCategoryDTO.name}, '%' )
        </if>
        ORDER BY weight DESC
    </select>
    <select id="selectAllCategories" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductCategoryVO">
        SELECT <include refid="Base_Column_List"/>
        FROM com_convenient_product_categories
        WHERE is_del = 0 AND merchant_id = #{merchantId} ORDER BY weight DESC
    </select>
 
</mapper>