<?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.system.mapper.HsPostConfigMapper">

    <resultMap type="com.willalp.system.domain.HsPostConfig" id="HsPostConfigResult">
        <result property="id" column="id"/>
        <result property="postNo" column="post_no"/>
        <result property="postName" column="post_name"/>
        <result property="postLevel" column="post_level"/>
        <result property="postUserG" column="post_user_g"/>
        <result property="orgCode" column="org_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="selectHsPostConfigVo">
        select id,
               post_no,
               post_name,
               post_level,
               post_user_g,
               org_code,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from hs_post_config
    </sql>

    <select id="selectHsPostConfigList" parameterType="HsPostConfig" resultMap="HsPostConfigResult">
        <include refid="selectHsPostConfigVo"/>
        <where>
            is_delete = 0
            <if test="postNo != null  and postNo != ''">
                and post_no like concat('%', #{postNo}, '%')
            </if>
            <if test="postName != null  and postName != ''">
                and post_name like concat('%', #{postName}, '%')
            </if>
            <if test="postLevel != null  and postLevel != ''">
                and post_level = #{postLevel}
            </if>
            <if test="postUserG != null  and postUserG != ''">
                and post_user_g = #{postUserG}
            </if>
            <if test="isDelete != null ">
                and is_delete = #{isDelete}
            </if>
        </where>
    </select>
</mapper>
