<?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.iocoder.yudao.module.system.dal.mysql.biz.SysChargeCategoryMapper">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="cn.iocoder.yudao.module.system.dal.dataobject.biz.SysChargeCategoryDO" id="sysChargeCategoryMap">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="parentId" column="parent_id"/>
        <result property="sort" column="sort"/>
        <result property="channelId" column="channel_id"/>
        <result property="remark" column="remark"/>
        <result property="status" column="status"/>
        <result property="createdBy" column="created_by"/>
        <result property="createTime" column="create_time"/>
    </resultMap>
    <select id="findPage" resultType="cn.iocoder.yudao.module.system.dal.dataobject.biz.SysChargeCategoryDO">
        select * from sys_charge_category where 1 = 1
        and parent_id = 0
        <if test="pageReqVO.name != null and pageReqVO.name != '' ">
            and name like concat('%',#{pageReqVO.name} ,'%')
        </if>
        <if test="pageReqVO.tenantIds != null">
            and tenant_id in
            <foreach item="id" collection="pageReqVO.tenantIds" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="pageReqVO.orgType != null">
            and org_type = #{pageReqVO.orgType}
        </if>
        order by create_time desc
    </select>


</mapper>