| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556 |
- <?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.UniversalMapper">
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- </sql>
- <!-- 查询所有的汽车衡 -->
- <select id="getAllCalculateMes" resultType="java.util.Map">
- select RTC.TRUCK_CALCULATE_ID "id",
- RTC.TRUCK_CALCULATE_ID "value",
- RTC.TRUCK_CALCULATE_NUMBER "label",
- RTC.TRUCK_CALCULATE_NUMBER "text"
- from RMS_TRUCK_CALCULATE RTC
- </select>
- <select id="getAllGatepost" resultType="java.util.Map">
- select GATEPOST_ID "id",
- GATEPOST_ID "value",
- GATEPOST_NAME "label",
- GATEPOST_NAME "text"
- from RMS_GATEPOST
- </select>
- <select id="getAllWareHouse" resultType="java.util.Map">
- select WAREHOUSE_ID "id",
- WAREHOUSE_ID "value",
- WAREHOUSE_NAME "label",
- WAREHOUSE_NAME "text"
- from RMS_WAREHOUSE
- </select>
- <select id="getColumnNoRoutList" resultType="java.lang.String" parameterType="map">
- select DTCR.COLUMN_NAME from DIL_TABLE_COLUMN_ROLE DTCR
- left join DIL_ROLE_ORGCODE_TABLE DROT
- ON DTCR.PRIMARY_ID = DROT.COLUMN_ID
- WHERE
- DTCR.TABLE_NAME = #{tableName}
- <if test="orgCode != null">
- and DROT.ORG_CODE = #{orgCode}
- </if>
- </select>
- <select id="getColumnShowData" resultType="java.util.Map" parameterType="map">
- SELECT DTCR.COLUMN_NAME "key",
- DTCR.COLUMN_NAME "label"
- FROM DIL_TABLE_COLUMN_ROLE DTCR
- LEFT JOIN DIL_ROLE_ORGCODE_TABLE DROT on DTCR.PRIMARY_ID = DROT.COLUMN_ID
- WHERE
- DTCR.TABLE_NAME = #{tableName}
- <if test="userName != null">
- AND nvl(DROT.USER_NAME,'0') != #{userName}
- </if>
- <if test="schemeName != null">
- AND nvl(DROT.PRIMARY_NAME,'0') != #{schemeName}
- </if>
- </select>
- <select id="getColumnHiddenData" resultType="string" parameterType="map">
- SELECT DTCR.COLUMN_NAME FROM DIL_ROLE_ORGCODE_TABLE DROT
- LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DTCR.PRIMARY_ID = DROT.COLUMN_ID
- WHERE
- DTCR.TABLE_NAME = #{tableName}
- <if test="userName != null">
- AND DROT.USER_NAME = #{userName}
- </if>
- <if test="orgCode != null">
- AND DROT.ORG_CODE = #{orgCode}
- </if>
- <if test="schemeName != null">
- AND nvl(DROT.PRIMARY_NAME,'0') = #{schemeName}
- </if>
- </select>
- <select id="getColumnAllData" resultType="java.util.Map" parameterType="map">
- SELECT DTCR.COLUMN_NAME "key",
- DTCR.COLUMN_NAME "label"
- FROM DIL_TABLE_COLUMN_ROLE DTCR
- WHERE DTCR.TABLE_NAME = #{tableName}
- </select>
- <select id="getColumnAllScheme" resultType="java.util.LinkedHashMap" parameterType="map">
- SELECT distinct DROT.PRIMARY_NAME "schemeName",
- DROT.ENABLE_STATUS "enableStatus",
- DROT.USER_NAME "userName",
- DROT.ORG_CODE "orgCode",
- DTCR.TABLE_NAME "tableName"
- FROM DIL_ROLE_ORGCODE_TABLE DROT
- LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DROT.COLUMN_ID = DTCR.PRIMARY_ID
- WHERE DROT.USER_NAME = #{userName}
- AND DROT.ORG_CODE = #{orgCode}
- AND DTCR.TABLE_NAME = #{tableName}
- AND NVL(DROT.PRIMARY_NAME, '') != '默认方案'
- </select>
- <select id="getWlUrl" resultType="java.lang.String">
- SELECT DL.VERSION_VALUE
- FROM DIL_VERSION DL
- WHERE DL.VERSION_ID = 11
- </select>
- <!-- 边输边查公司 -->
- <select id="getCompanyMesByLike" resultType="java.util.Map">
- select * from(
- select
- RC.COMPANY_ID "companyId",
- RC.COMPANY_NAME "companyName",
- RC.COMPANY_TYPE "companyType",
- RC.SSO_ID "ssoId",
- RC.SSO_CODE "ssoCode",
- RC.COMPANY_ID "id",
- RC.COMPANY_ID "value",
- <if test="companyType==null">
- RC.COMPANY_TYPE || '-' ||
- </if>
- RC.COMPANY_NAME "label",
- RC.COMPANY_NAME "text"
- from RMS_COMPANY RC
- where DELETED = 0 )
- <where>
- <if test="companyType!=null and companyType!=''">
- AND "companyType" = #{companyType}
- </if>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getMaterialTypeByLike" resultType="java.util.Map">
- select * from(
- select
- MATERIAL_TYPE_ID "materialTypeId",
- MATERIAL_TYPE_NAME "materialTypeName",
- MATERIAL_TYPE_ID "id",
- MATERIAL_TYPE_ID "value",
- MATERIAL_TYPE_NAME "label",
- MATERIAL_TYPE_NAME "text"
- from RMS_MATERIAL_TYPE
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getEmissionStandardByLike" resultType="java.util.Map">
- select * from (
- select
- EMISSION_STANDARD_ID "emissionStandardId",
- EMISSION_STANDARD_NAME "emissionStandardName",
- EMISSION_STANDARD_ID "id",
- EMISSION_STANDARD_ID "value",
- EMISSION_STANDARD_NAME "label",
- EMISSION_STANDARD_NAME "text"
- from RMS_EMISSION_STANDARD
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getOperationPointByLike" resultType="java.util.Map">
- select * from (
- select
- OPERATION_POINT_ID "operationPointId",
- OPERATION_POINT_NAME "operationPointName",
- OPERATION_POINT_TYPE "operationPointType",
- OPERATION_POINT_ID "id",
- OPERATION_POINT_ID "value",
- OPERATION_POINT_NAME "label",
- OPERATION_POINT_NAME "text"
- from RMS_OPERATION_POINT
- where DELETED = 0
- )
- <where>
- <if test="operationPointType!=null and operationPointType!=''">
- AND REGEXP_LIKE("operationPointType", #{operationPointType})
- </if>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getPersonnelByLike" resultType="java.util.Map">
- select * from (
- select
- PERSONNEL_ID "personnelId",
- PERSONNEL_NAME "personnelName",
- PERSONNEL_POST "personnelPost",
- PERSONNEL_ID "id",
- PERSONNEL_ID "value",
- PERSONNEL_NAME "label",
- PERSONNEL_NAME "text"
- from RMS_PERSONNEL
- where DELETED = 0
- )
- <where>
- <if test="personnelPost!=null and personnelPost!=''">
- AND "personnelPost" = #{personnelPost}
- </if>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getCapacityByLike" resultType="java.util.Map">
- select * from (
- SELECT DISTINCT
- RCA .CAPACITY_ID "capacityId",
- RCA .CAPACITY_ID "id",
- RCA .CAPACITY_ID "value",
- RCA .CAPACITY_NUMBER "label",
- RCA .CAPACITY_NUMBER "text"
- FROM RMS_CAPACITY RCA
- LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
- LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
- LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
- WHERE RCA .DELETED = 0
- <if test="orgCode!=null and orgCode !='' and roleCodes.contains('chengyunshang')">
- AND RC.SSO_CODE = #{orgCode}
- </if>
- <if test="capacityType != null and capacityType != '' ">
- AND RCT.CAPACITY_TYPE_NAME = #{capacityType}
- </if>
- <if test="capacityType == null">
- AND RCT.CAPACITY_TYPE_NAME != '火车'
- </if>
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
- select * from(
- select
- RC.JOB_ID "jboId",
- RC.JOB_NAME "jobName",
- RC.JOB_ID "id",
- RC.JOB_ID "value",
- RC.JOB_NAME "label",
- RC.JOB_NAME "text"
- from RMS_JOB_INFO RC
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getTransRangeByLike" resultType="java.util.Map">
- select * from(
- select
- RC.TRANS_RANGE_ID "transrangeId",
- RC.TRANS_RANGE_NAME "transrangeName",
- RC.TRANS_RANGE_ID "id",
- RC.TRANS_RANGE_ID "value",
- RC.TRANS_RANGE_NAME "label",
- RC.TRANS_RANGE_NAME "text"
- from RMS_TRANS_RANGE RC
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and id.size>0 and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getCategoryCodeByLike" resultType="java.util.Map">
- select * from(
- select
- RC.RULES_ID "rulesId",
- RC.RULES_CODE "rulesCode",
- RC.RULES_ID "id",
- RC.RULES_ID "value",
- RC.RULES_CODE "label",
- RC.RULES_CODE "text"
- from RMS_DEMAND_RULES RC
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getCapacityTypeByLike" resultType="java.util.Map">
- select * from(
- select
- RC.CAPACITY_TYPE_ID "capacityTypeId",
- RC.CAPACITY_TYPE_NAME "capacityTypeName",
- RC.CAPACITY_TYPE_ID "id",
- RC.CAPACITY_TYPE_ID "value",
- RC.CAPACITY_TYPE_NAME "label",
- RC.CAPACITY_TYPE_NAME "text"
- from RMS_CAPACITY_TYPE RC
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getLineByLike" resultType="java.util.Map">
- select * from(
- select
- RL.LINE_ID "lineId",
- RL.LINE_NAME "lineName",
- RL.LINE_ID "id",
- RL.LINE_ID "value",
- RL.LINE_NAME "label",
- RL.LINE_NAME "text",
- NVL(RL_TEMP."points",'无') "points"
- from RMS_LINE RL
- LEFT JOIN
- (
- SELECT
- RLS .LINE_ID "lineId",
- listagg (DISTINCT ROP .OPERATION_POINT_NAME, ',') WITHIN GROUP (ORDER BY RLS .LINE_ID) "points"
- FROM
- RMS_LINE_STEP RLS
- LEFT JOIN RMS_STEP_POINT RSP
- ON RLS .STEP_ID = RSP .STEP_ID
- LEFT JOIN RMS_OPERATION_POINT ROP
- ON RSP .OPERATION_POINT_ID = ROP .OPERATION_POINT_ID
- GROUP BY RLS .LINE_ID
- ) RL_TEMP ON RL_TEMP ."lineId" = RL .LINE_ID
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label" || "points", #{index})
- </if>
- <if test="id!=null and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="getMaterialByLike" resultType="java.util.Map">
- select * from(
- select
- RC.MATERIAL_ID "materialId",
- RC.MATERIAL_NAME "materialName",
- RC.MATERIAL_ID "id",
- RC.MATERIAL_ID "value",
- RC.MATERIAL_NAME "label",
- RC.MATERIAL_NAME "text"
- from RMS_MATERIAL RC
- where DELETED = 0
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="id!=null and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="countTrainLoad" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM TMS_LOAD_RESULT TLR
- LEFT JOIN OMS_TRANS_ORDER OTO ON TLR .TRANS_ORDER_ID =OTO .TRANS_ORDER_ID
- LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
- LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
- LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
- LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
- <where>
- OTO.DELETED != 1
- AND ATR.SERIAL_NUMBER =#{requirementNumber}
- AND TLR.LOAD_START_TIME = to_date(#{loadTime}, 'yyyymmdd')
- AND OTO.CAPACITY_ID IN
- <foreach collection="list" item="item" open="(" close=")" separator="," >
- #{item.车号}
- </foreach>
- </where>
- </select>
- <select id="getBusinessTypeLike" resultType="java.util.Map">
- select * from(
- select
- DBT.BUSINESS_TYPE_ID "businessTypeId",
- DBT.BUSINESS_TYPE_ID "id",
- DBT.BUSINESS_TYPE_ID "value",
- DBT.BUSINESS_TYPE_NAME "text",
- DBT.BUSINESS_TYPE_NAME "businessTypeName",
- DBT.BUSINESS_SCENE "businessScene",
- DBT.BUSINESS_TYPE_NAME "label",
- DBT.ALTERNATE_FIELDS1 "transportType",
- DBT.ALTERNATE_FIELDS2 "materialTypeName"
- from DIL_BUSINESS_TYPE DBT
- )
- <where>
- <if test="index!=null and index!=''">
- AND REGEXP_LIKE("label", #{index})
- </if>
- <if test="businessType!=null and businessType!=''">
- AND "businessTypeId" = #{businessType}
- </if>
- <if test="businessScene!=null and businessScene!=''">
- AND "businessScene" = #{businessScene}
- </if>
- <if test="transportType!=null and transportType!=''">
- AND REGEXP_LIKE("transportType", #{transportType})
- </if>
- <if test="materialTypeName!=null and materialTypeName!=''">
- AND REGEXP_LIKE("materialTypeName", #{materialTypeName})
- </if>
- <if test="id!=null and !(index!=null and index!='')">
- AND "id" in
- <foreach collection="id" item="item" open="(" close=")" separator="," >
- #{item}
- </foreach>
- </if>
- </where>
- FETCH NEXT 100 ROWS ONLY
- </select>
- <select id="findTrainWeight" resultType="java.util.Map">
- <foreach collection="list" item="item" separator=" UNION " >
- SELECT OTO .TRANS_ORDER_ID "transOrderId",
- TWR .RESULT_ID "resultId",
- #{item.车号} "capacityId",
- #{item.净重} "netWeight",
- #{item.皮重} "tareWeight",
- #{item.毛重} "grossWeight"
- FROM OMS_TRANS_ORDER OTO
- LEFT JOIN TMS_WEIGHT_RESULT TWR
- ON TWR .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID AND TWR.NET_WEIGHT_TIME = to_date(#{weightTime}, 'yyyymmdd')
- LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
- LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
- LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
- LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
- <where>
- OTO.DELETED != 1
- AND ATR.SERIAL_NUMBER =#{requirementNumber}
- AND OTO.CAPACITY_ID = #{item.车号}
- </where>
- </foreach>
- </select>
- <select id="findTrainUnload" resultType="java.util.Map">
- <foreach collection="list" item="item" separator=" UNION " >
- SELECT OTO .TRANS_ORDER_ID "transOrderId",
- TUR .RESULT_ID "resultId",
- #{item.车号} "capacityId",
- #{item.净重} "unloadWeight"
- FROM OMS_TRANS_ORDER OTO
- LEFT JOIN TMS_UNLOAD_RESULT TUR
- ON TUR .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID AND TUR.UNLOAD_START_TIME = to_date(#{unloadTime}, 'yyyymmdd')
- LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
- LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
- LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
- LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
- <where>
- OTO.DELETED != 1
- AND ATR.SERIAL_NUMBER =#{requirementNumber}
- AND OTO.CAPACITY_ID = #{item.车号}
- </where>
- </foreach>
- </select>
- <select id="getOrderIds" resultType="java.util.Map">
- SELECT oto.TRANS_ORDER_ID FROM OMS_TRANS_ORDER OTO
- left join RMS_PERSONNEL RP
- on rp.PERSONNEL_ID = oto.DRIVER_ID
- left join RMS_PERSONNEL RP2
- on RP2.PERSONNEL_ID = oto.DRIVER_ID2
- where (rp.PERSONNEL_JOB_NUMBER = #{jobNumber}
- or rp2.PERSONNEL_JOB_NUMBER = #{jobNumber})
- and oto.deleted = 5
- </select>
- </mapper>
|