<?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.njcn.process.mapper.LoadTypeUserManageMapper">

    <select id="getLoadTypeUserPage" resultType="RLoadTypeUserManageVO">
        SELECT
            *
        FROM
            r_load_type_user_manage r
        where 1=1
        <if test="loadTypeUserSearchParam.orgNo != null and loadTypeUserSearchParam.orgNo != ''">
            and r.org_no = #{loadTypeUserSearchParam.orgNo}
        </if>
        <if test="loadTypeUserSearchParam.loadType != null and loadTypeUserSearchParam.loadType != ''">
            and r.load_type = #{loadTypeUserSearchParam.loadType}
        </if>
        <if test="loadTypeUserSearchParam.userName != null and loadTypeUserSearchParam.userName != ''">
            and r.user_name like CONCAT('%', #{loadTypeUserSearchParam.userName}, '%')
        </if>
        <if test="loadTypeUserSearchParam.fileUploadflag != null and loadTypeUserSearchParam.fileUploadflag != ''">
            and r.i_is_file_upload = #{loadTypeUserSearchParam.fileUploadflag}
        </if>
    </select>

    <select id="getLoadTypeRelationPage" resultType="RLoadTypeUserManageVO">
        SELECT
        *
        FROM
        r_load_type_user_manage r
        where 1=1
        AND ISNULL( relation_user_id )= 0
        AND LENGTH(
        trim( relation_user_id ))> 0
        <if test="loadTypeUserSearchParam.orgNo != null and loadTypeUserSearchParam.orgNo != ''">
            and r.org_no = #{loadTypeUserSearchParam.orgNo}
        </if>
        <if test="loadTypeUserSearchParam.loadType != null and loadTypeUserSearchParam.loadType != ''">
            and r.load_type = #{loadTypeUserSearchParam.loadType}
        </if>
        <if test="loadTypeUserSearchParam.userName != null and loadTypeUserSearchParam.userName != ''">
            and r.user_name like CONCAT('%', #{loadTypeUserSearchParam.userName}, '%')
        </if>
        <if test="loadTypeUserSearchParam.relationUserName != null and loadTypeUserSearchParam.relationUserName != ''">
            and r.relation_user_name like CONCAT('%', #{loadTypeUserSearchParam.relationUserName}, '%')
        </if>
        <if test="loadTypeUserSearchParam.aIsFileUpload != null and loadTypeUserSearchParam.aIsFileUpload != ''">
            and r.a_is_file_upload = #{loadTypeUserSearchParam.aIsFileUpload}
        </if>
    </select>

</mapper>
