<?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.yiqing.mapper.HsYiqingQueGroupMapper">

    <resultMap type="com.willalp.yiqing.domain.HsYiqingQueGroup" id="HsYiqingQueGroupResult">
        <result property="queGroupId" column="que_group_id"/>
        <result property="queGroupName" column="que_group_name"/>
        <result property="orgNo" column="org_no"/>
        <result property="remark" column="remark"/>
        <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"/>
    </resultMap>

    <sql id="selectHsYiqingQueGroupVo">
        select que_group_id,
               que_group_name,
               org_no,
               remark,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time
        from hs_yiqing_que_group
    </sql>

    <select id="selectHsYiqingQueGroupList" parameterType="HsYiqingQueGroup" resultMap="HsYiqingQueGroupResult">
        <include refid="selectHsYiqingQueGroupVo"/>
        <where>
            is_delete = 0
            <if test="queGroupName != null  and queGroupName != ''">
                  and que_group_name like concat('%', #{queGroupName}, '%')
            </if>
            <if test="orgNo != null  and orgNo != ''">
                  and org_no like concat('%', #{orgNo}, '%')
                        </if>
        </where>
    </select>
</mapper>
