|
|
@@ -0,0 +1,88 @@
|
|
|
+<?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="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+ <sql id="timeFilter">
|
|
|
+ <if test="oneDate != null">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= ${timeFilterProp}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= ${timeFilterProp}
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ${timeFilterProp}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+ <sql id="companyFilter">
|
|
|
+ <if test="${companyType} != null">
|
|
|
+ <if test="!roleCodes.contains('admin') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
+ AND ${prop}
|
|
|
+ in
|
|
|
+ <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
+ <if test="item.companyType == ${companyType}">
|
|
|
+ #{item.companyId}
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="${companyType} == null">
|
|
|
+ <if test="!roleCodes.contains('admin') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
+ AND ${prop}
|
|
|
+ in
|
|
|
+ <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.companyId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+ <sql id="rootCompanyFilter">
|
|
|
+ <if test="rootCompanyMap != null and (rootCompanyMap.rootCompanyName.contains('安泰') or rootCompanyMap.rootCompanyName.contains('新泰'))">
|
|
|
+ AND "rootCompanyId" = #{rootCompanyMap.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="," item="item" index="index">
|
|
|
+ #{item.companyId}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <when test="item == 'shippingCompany'">
|
|
|
+ "shippingCompanyId"
|
|
|
+ in
|
|
|
+ <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
|
|
|
+ #{item.companyId}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <when test="item == 'receivingCompany'">
|
|
|
+ "receivingCompanyId"
|
|
|
+ in
|
|
|
+ <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
|
|
|
+ #{item.companyId}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <when test="item == 'businessCompany'">
|
|
|
+ "businessCompanyId"
|
|
|
+ in
|
|
|
+ <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
|
|
|
+ #{item.companyId}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ 1 = 1
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+</mapper>
|