|
|
@@ -83,7 +83,6 @@
|
|
|
WHERE DL.VERSION_ID = 11
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
<!-- 边输边查公司 -->
|
|
|
<select id="getCompanyMesByLike" resultType="java.util.Map">
|
|
|
select * from(
|
|
|
@@ -93,6 +92,7 @@
|
|
|
RC.COMPANY_ID "id",
|
|
|
RC.COMPANY_ID "key",
|
|
|
RC.COMPANY_ID "value",
|
|
|
+ RC.COMPANY_ID "carrierId",
|
|
|
<if test="companyType==null">
|
|
|
RC.COMPANY_TYPE || '-' ||
|
|
|
</if>
|
|
|
@@ -150,38 +150,6 @@
|
|
|
<if test="index!=null and index!=''">
|
|
|
AND REGEXP_LIKE(RC.COMPANY_NAME, #{index})
|
|
|
</if>
|
|
|
- <if test="roleCodes.contains('shippingCompany') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
- or RC.COMPANY_ID in
|
|
|
- <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
- <if test="companyType == '发货单位'">
|
|
|
- #{item.companyId}
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="roleCodes.contains('recevingCompany') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
- or RC.COMPANY_ID in
|
|
|
- <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
- <if test="companyType == '收货单位'">
|
|
|
- #{item.companyId}
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="roleCodes.contains('carrierCompany') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
- or RC.COMPANY_ID in
|
|
|
- <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
- <if test="companyType == '承运单位'">
|
|
|
- #{item.companyId}
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="roleCodes.contains('businessCompany') and dilCompanyList != null and dilCompanyList.size > 0">
|
|
|
- or RC.COMPANY_ID in
|
|
|
- <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
|
|
|
- <if test="companyType == '业务单位'">
|
|
|
- #{item.companyId}
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
</where>
|
|
|
<if test="noRow == null">
|
|
|
order by LENGTH(company_name)
|
|
|
@@ -196,6 +164,7 @@
|
|
|
RC.COMPANY_ID "id",
|
|
|
RC.COMPANY_ID "key",
|
|
|
RC.COMPANY_ID "value",
|
|
|
+ RC.COMPANY_ID "carrierId",
|
|
|
<if test="companyType==null">
|
|
|
RC.COMPANY_TYPE || '-' ||
|
|
|
</if>
|
|
|
@@ -342,7 +311,9 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getPersonnelByLike" resultType="java.util.Map">
|
|
|
+ select * from (
|
|
|
select * from (
|
|
|
select * from (
|
|
|
select
|
|
|
@@ -355,8 +326,21 @@
|
|
|
PERSONNEL_NAME "label",
|
|
|
PERSONNEL_NAME "text",
|
|
|
'personnelName' "prop"
|
|
|
- from RMS_PERSONNEL
|
|
|
- where DELETED = 0
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ ,NVL(T ."countNumber",0) "countNumber"
|
|
|
+ </if>
|
|
|
+ FROM
|
|
|
+ RMS_PERSONNEL RP
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT DRIVER_ID "driverId",
|
|
|
+ COUNT(DRIVER_ID) "countNumber"
|
|
|
+ FROM OMS_TRANS_ORDER
|
|
|
+ WHERE CAPACITY_ID = #{capacityId}
|
|
|
+ GROUP BY DRIVER_ID
|
|
|
+ ) T ON T."driverId" = RP .PERSONNEL_ID
|
|
|
+ </if>
|
|
|
+ WHERE DELETED = 0
|
|
|
<if test="isNC!=null">
|
|
|
AND SOURCE_ID IS NOT NULL
|
|
|
</if>
|
|
|
@@ -378,6 +362,9 @@
|
|
|
AND REGEXP_LIKE("label", #{index})
|
|
|
</if>
|
|
|
</where>
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ ORDER BY "countNumber" DESC
|
|
|
+ </if>
|
|
|
FETCH NEXT 10 ROWS ONLY
|
|
|
)
|
|
|
<if test="id!=null and id.size>0">
|
|
|
@@ -392,29 +379,67 @@
|
|
|
PERSONNEL_NAME "label",
|
|
|
PERSONNEL_NAME "text",
|
|
|
'personnelName' "prop"
|
|
|
- from RMS_PERSONNEL
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ ,NVL(T ."countNumber",0) "countNumber"
|
|
|
+ </if>
|
|
|
+ from RMS_PERSONNEL RP
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT DRIVER_ID "driverId",
|
|
|
+ COUNT(DRIVER_ID) "countNumber"
|
|
|
+ FROM OMS_TRANS_ORDER
|
|
|
+ WHERE CAPACITY_ID = #{capacityId}
|
|
|
+ GROUP BY DRIVER_ID
|
|
|
+ ) T ON T."driverId" = RP .PERSONNEL_ID
|
|
|
+ </if>
|
|
|
WHERE PERSONNEL_ID in
|
|
|
<foreach collection="id" item="item" open="(" close=")" separator="," >
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ )
|
|
|
+ <if test="capacityId!=null and capacityId!=''">
|
|
|
+ ORDER BY "countNumber" DESC
|
|
|
+ </if>
|
|
|
</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",
|
|
|
- RCA.CAPACITY_NUMBER "capacityNumber",
|
|
|
- 'capacityNumber' "prop"
|
|
|
- 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')">
|
|
|
+ select * from (
|
|
|
+ SELECT DISTINCT
|
|
|
+ RCA .CAPACITY_ID "capacityId",
|
|
|
+ RCA .CAPACITY_ID "id",
|
|
|
+ RCA .CAPACITY_ID "value",
|
|
|
+ RCA .CAPACITY_NUMBER "label",
|
|
|
+ RCA .CAPACITY_NUMBER "text",
|
|
|
+ RCA.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ 'capacityNumber' "prop"
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ ,NVL(T ."countNumber",0) "countNumber"
|
|
|
+ </if>
|
|
|
+ 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
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT CAPACITY_ID "capacityId",
|
|
|
+ COUNT( CAPACITY_ID ) "countNumber"
|
|
|
+ FROM OMS_TRANS_ORDER
|
|
|
+ <where>
|
|
|
+ <if test="driverId!=null and driverId!=''">
|
|
|
+ AND (DRIVER_ID = #{driverId} OR DRIVER_ID2 = #{driverId})
|
|
|
+ </if>
|
|
|
+ <if test="driverId2!=null and driverId2!=''">
|
|
|
+ AND DRIVER_ID = #{driverId2} OR DRIVER_ID2 = #{driverId2}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY CAPACITY_ID
|
|
|
+ ) T ON T."capacityId" = RCA .CAPACITY_ID
|
|
|
+ </if>
|
|
|
+ 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 != '' ">
|
|
|
@@ -429,6 +454,9 @@
|
|
|
<if test="capacityId!=null and capacityId!=''">
|
|
|
AND RCA .CAPACITY_ID = #{capacityId}
|
|
|
</if>
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ ORDER BY "countNumber" DESC
|
|
|
+ </if>
|
|
|
FETCH NEXT 10 ROWS ONLY
|
|
|
)
|
|
|
<if test="id!=null and id.size>0">
|
|
|
@@ -441,16 +469,40 @@
|
|
|
RCA .CAPACITY_NUMBER "text",
|
|
|
RCA.CAPACITY_NUMBER "capacityNumber",
|
|
|
'capacityNumber' "prop"
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ ,NVL(T ."countNumber",0) "countNumber"
|
|
|
+ </if>
|
|
|
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
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT CAPACITY_ID "capacityId",
|
|
|
+ COUNT( CAPACITY_ID ) "countNumber"
|
|
|
+ FROM OMS_TRANS_ORDER
|
|
|
+ <where>
|
|
|
+ <if test="driverId!=null and driverId!=''">
|
|
|
+ AND (DRIVER_ID = #{driverId} OR DRIVER_ID2 = #{driverId})
|
|
|
+ </if>
|
|
|
+ <if test="driverId2!=null and driverId2!=''">
|
|
|
+ AND DRIVER_ID = #{driverId2} OR DRIVER_ID2 = #{driverId2}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY CAPACITY_ID
|
|
|
+ ) T ON T."capacityId" = RCA .CAPACITY_ID
|
|
|
+ </if>
|
|
|
WHERE RCA .CAPACITY_ID in
|
|
|
- <foreach collection="id" item="item" open="(" close=")" separator="," >
|
|
|
+ <foreach collection="id" item="item" open="(" close=")" separator="," >
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ )
|
|
|
+ <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
|
|
|
+ ORDER BY "countNumber" DESC
|
|
|
+ </if>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
|
|
|
select * from(
|
|
|
select
|
|
|
@@ -560,6 +612,13 @@
|
|
|
<if test="capacityTypeId!=null and capacityTypeId!=''">
|
|
|
AND RCT.CAPACITY_TYPE_ID = #{capacityTypeId}
|
|
|
</if>
|
|
|
+ <if test="capacityTypeNameList != null and capacityTypeNameList.size > 0">
|
|
|
+ and
|
|
|
+ RCT.CAPACITY_TYPE_NAME in
|
|
|
+ <foreach collection="capacityTypeNameList" index="index" item="item" separator="," close=")" open="(">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
GROUP BY RCT .CAPACITY_TYPE_ID,RCT.CAPACITY_TYPE_NAME,RCT .CAPACITY_MAX_LOAD
|
|
|
FETCH NEXT 10 ROWS ONLY
|
|
|
@@ -584,6 +643,13 @@
|
|
|
<foreach collection="id" item="item" open="(" close=")" separator="," >
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ <if test="capacityTypeNameList != null and capacityTypeNameList.size > 0">
|
|
|
+ and
|
|
|
+ RCT.CAPACITY_TYPE_NAME in
|
|
|
+ <foreach collection="capacityTypeNameList" index="index" item="item" separator="," close=")" open="(">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
GROUP BY RCT .CAPACITY_TYPE_ID,RCT.CAPACITY_TYPE_NAME,RCT .CAPACITY_MAX_LOAD
|
|
|
</if>
|
|
|
</select>
|
|
|
@@ -927,12 +993,23 @@
|
|
|
t.create_emp as "createEmp",
|
|
|
t.create_time as "createTime",
|
|
|
b.material_specification as "specName",
|
|
|
- nvl(substr(b.material_specification,
|
|
|
- decode(instr(b.material_specification, '/'),
|
|
|
- 0,
|
|
|
- 100,
|
|
|
- instr(b.material_specification, '/')) + 1),
|
|
|
- 12) * b.material_theoretical_weight / 1000 as "weight"
|
|
|
+ CASE WHEN
|
|
|
+ REGEXP_LIKE(nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12),'^\d+$') THEN
|
|
|
+ nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12)
|
|
|
+ ELSE
|
|
|
+ '0'
|
|
|
+ END
|
|
|
+ * b.material_theoretical_weight / 1000 as "weight"
|
|
|
from rms_material b
|
|
|
left join rms_material_map t
|
|
|
on t.prod_code_l = b.material_code
|
|
|
@@ -950,12 +1027,22 @@
|
|
|
'' as "createEmp",
|
|
|
sysdate as "createTime",
|
|
|
b.material_specification as "specName",
|
|
|
- nvl(substr(b.material_specification,
|
|
|
- decode(instr(b.material_specification, '/'),
|
|
|
- 0,
|
|
|
- 100,
|
|
|
- instr(b.material_specification, '/')) + 1),
|
|
|
- 12) * b.material_theoretical_weight / 1000 as "weight"
|
|
|
+ CASE WHEN
|
|
|
+ REGEXP_LIKE(nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12),'^\d+$') THEN
|
|
|
+ nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12)
|
|
|
+ ELSE
|
|
|
+ '0'
|
|
|
+ END * b.material_theoretical_weight / 1000 as "weight"
|
|
|
from rms_material b
|
|
|
<where>
|
|
|
<if test="prodCode != null and prodCode != ''">
|