<?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.willalp.flow.mapper.HsFlowExamplesMapper">

    <resultMap type="com.willalp.flow.domain.HsFlowExamples" id="HsFlowExamplesResult">
        <result property="id" column="id"/>
        <result property="examplesName" column="examples_name"/>
        <result property="examplesCode" column="examples_code"/>
        <result property="businessTableName" column="business_table_name"/>
        <result property="isDelete" column="is_delete"/>
        <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"/>
    </resultMap>

    <sql id="selectHsFlowExamplesVo">
        select id,
               examples_name,
               examples_code,
               business_table_name,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from hs_flow_examples
    </sql>

    <select id="selectHsFlowExamplesList" parameterType="HsFlowExamples" resultMap="HsFlowExamplesResult">
        <include refid="selectHsFlowExamplesVo"/>
        <where>
            is_delete = 0
            <if test="examplesName != null  and examplesName != ''">
                and examples_name like concat('%', #{examplesName}, '%')
            </if>
            <if test="examplesCode != null  and examplesCode != ''">
                and examples_code = #{examplesCode}
            </if>
            <if test="isDelete != null ">
                and is_delete = #{isDelete}
            </if>
        </where>
    </select>
</mapper>
