<?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.flowable.mapper.WfCategoryMapper">

    <resultMap type="WfCategory" id="CategoryResult">
        <result property="categoryId" column="category_id"/>
        <result property="categoryName" column="category_name"/>
        <result property="code" column="code"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
        <result property="delFlag" column="del_flag"/>
    </resultMap>

    <sql id="selectCategoryVo">
        select
            category_id,
            category_name,
            code,
            remark,
            create_by,
            create_time,
            update_by,
            update_time,
            del_flag
        from wf_category
    </sql>

    <select id="selectWfCategoryPage" resultMap="CategoryResult">
        <include refid="selectCategoryVo"/>
        <where>
            <if test="categoryName != null  and categoryName != ''">and category_name = #{categoryName}</if>
            <if test="code != null  and code != ''">and code like concat('%', #{code}, '%')</if>
        </where>
        ORDER BY create_time DESC
    </select>

</mapper>
