| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?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.steerinfo.dil.mapper.CommonMapper">
- <sql id="orderBy">
- <if test="orderByField!=null and orderByField !=''">
- order by "${orderByField}"
- <if test="orderByType == 'desc'">
- desc
- </if>
- <if test="orderByType == 'asc'">
- asc
- </if>
- </if>
- </sql>
- <sql id="rootCompanyFilter">
- <if test="rootCompanyMap != null and urlFlag != null and urlFlag != 'null' and urlFlag != ''">
- AND #{urlFlag} = (SELECT IS_LISTED FROM RMS_COMPANY WHERE COMPANY_ID = "rootCompanyId")
- </if>
- </sql>
- <sql id="filterCompanyData">
- <if test="roleCodes != null and roleCodes.size > 0 and dilCompanyList != null and dilCompanyList.size > 0" >
- AND
- <foreach collection="roleCodes" index="index" item="item" separator="or" close=")" open="(">
- <choose>
- <when test="item == 'chengYunShang'">
- (
- "carrierId"
- in
- <foreach collection="dilCompanyList" open="(" close=")" separator=" UNION " item="item" index="index">
- SELECT
- COMPANY_ID
- FROM
- RMS_COMPANY WHERE COMPANY_NAME IN ( SELECT COMPANY_NAME FROM RMS_COMPANY WHERE COMPANY_ID =
- #{item.companyId})
- </foreach>
- OR
- "shippingCompanyId"
- in
- <foreach collection="dilCompanyList" open="(" close=")" separator=" UNION " item="item" index="index">
- SELECT
- COMPANY_ID
- FROM
- RMS_COMPANY WHERE COMPANY_NAME IN ( SELECT COMPANY_NAME FROM RMS_COMPANY WHERE COMPANY_ID = #{item.companyId})
- </foreach>
- OR
- "receivingCompanyId"
- in
- <foreach collection="dilCompanyList" open="(" close=")" separator=" UNION " item="item" index="index">
- SELECT
- COMPANY_ID
- FROM
- RMS_COMPANY WHERE COMPANY_NAME IN ( SELECT COMPANY_NAME FROM RMS_COMPANY WHERE COMPANY_ID = #{item.companyId})
- </foreach>
- )
- </when>
- <when test="item == 'businessCompany'">
- "businessCompanyId"
- in
- <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
- #{item.companyId}
- </foreach>
- </when>
- <when test="item == 'approveBusinessCompany'">
- "approveBusinessCompanyId"
- in
- <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
- #{item.companyId}
- </foreach>
- </when>
- <when test="item.contains('admin')">
- 1 = 1
- </when>
- <when test="item.contains('siji')">
- 1 = 1
- </when>
- <otherwise>
- 1 != 1
- </otherwise>
- </choose>
- </foreach>
- </if>
- </sql>
- </mapper>
|