<?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.ruoyi.busi.mapper.BusiCategoryMapper">
    
    <resultMap type="BusiCategory" id="BusiCategoryResult">
        <result property="id"    column="id"    />
        <result property="code"    column="code"    />
        <result property="catgName"    column="catg_name"    />
        <result property="catgLevel"    column="catg_level"    />
        <result property="catgType"    column="catg_type"    />
        <result property="parentId"    column="parent_id"    />
        <result property="prodsJunior"    column="prods_junior"    />
        <result property="prodsAll"    column="prods_all"    />
        <result property="title"    column="title"    />
        <result property="keyword"    column="keyword"    />
        <result property="description"    column="description"    />
        <result property="sort"    column="sort"    />
        <result property="content"    column="content"    />
        <result property="prodUp"    column="prod_up"    />
        <result property="prodDown"    column="prod_down"    />
        <result property="tenantId"    column="tenant_id"    />
        <result property="creator"    column="creator"    />
        <result property="createTime"    column="create_time"    />
        <result property="updater"    column="updater"    />
        <result property="updateTime"    column="update_time"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>

    <sql id="selectBusiCategoryVo">
        select id, code, catg_name, catg_level, catg_type, parent_id, prods_junior, prods_all, title, keyword, description, sort, content, prod_up, prod_down, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_category
    </sql>

    <select id="queryListPage" parameterType="BusiCategory" resultMap="BusiCategoryResult">
        <include refid="selectBusiCategoryVo"/>
        <where>
                        <if test="entity.code != null  and entity.code != ''"> and code = #{entity.code}</if>
                        <if test="entity.catgName != null  and entity.catgName != ''"> and catg_name like concat('%', #{entity.catgName}, '%')</if>
                        <if test="entity.catgLevel != null "> and catg_level = #{entity.catgLevel}</if>
                        <if test="entity.catgType != null  and entity.catgType != ''"> and catg_type = #{entity.catgType}</if>
                        <if test="entity.parentId != null  and entity.parentId != ''"> and parent_id = #{entity.parentId}</if>
                        <if test="entity.prodsJunior != null "> and prods_junior = #{entity.prodsJunior}</if>
                        <if test="entity.prodsAll != null "> and prods_all = #{entity.prodsAll}</if>
                        <if test="entity.title != null  and entity.title != ''"> and title = #{entity.title}</if>
                        <if test="entity.keyword != null  and entity.keyword != ''"> and keyword = #{entity.keyword}</if>
                        <if test="entity.description != null  and entity.description != ''"> and description = #{entity.description}</if>
                        <if test="entity.sort != null "> and sort = #{entity.sort}</if>
                        <if test="entity.content != null  and entity.content != ''"> and content = #{entity.content}</if>
                        <if test="entity.prodUp != null  and entity.prodUp != ''"> and prod_up = #{entity.prodUp}</if>
                        <if test="entity.prodDown != null  and entity.prodDown != ''"> and prod_down = #{entity.prodDown}</if>
                        <if test="entity.tenantId != null  and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
        </where>
    </select>
</mapper>