<?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.HsFlowModelMapper">

    <resultMap type="com.willalp.flow.domain.HsFlowModel" id="HsFlowModelResult">
                    <result property="id" column="id"/>
                    <result property="flowModelName" column="flow_model_name"/>
                    <result property="flowModelCode" column="flow_model_code"/>
                    <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="selectHsFlowModelVo">
        select id, flow_model_name, flow_model_code, is_delete, create_by, create_time, update_by, update_time, remark        from hs_flow_model
    </sql>

    <select id="selectHsFlowModelList" parameterType="HsFlowModel" resultMap="HsFlowModelResult">
        <include refid="selectHsFlowModelVo"/>
        <where>
            is_delete = 0
                                                                                                    <if test="flowModelName != null  and flowModelName != ''">
                            and flow_model_name like concat('%', #{flowModelName}, '%')
                        </if>
                                                                                                            <if test="flowModelCode != null  and flowModelCode != ''">
                            and flow_model_code = #{flowModelCode}
                        </if>
                                                                                                            <if test="isDelete != null ">
                            and is_delete = #{isDelete}
                        </if>
                                                                                                                                                                                                    </where>
    </select>
</mapper>
