|
|
|
|
@ -23,7 +23,7 @@ |
|
|
|
|
<result column="MEMO" property="memo"/> |
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
<resultMap id="statementVOResultMap" type="org.springblade.desk.oem.pojo.vo.StatementVO"> |
|
|
|
|
<resultMap id="StatementVOResultMap" type="org.springblade.desk.oem.pojo.vo.StatementVO"> |
|
|
|
|
<!-- 基础字段映射 --> |
|
|
|
|
<result column="ID" property="id"/> |
|
|
|
|
<result column="TENANT_ID" property="tenantId"/> |
|
|
|
|
@ -102,37 +102,14 @@ |
|
|
|
|
<result column="STATEMENT_CATEGORY_ID" property="statementCategoryId"/> |
|
|
|
|
<result column="STATEMENT_CATEGORY" property="statementCategory"/> |
|
|
|
|
<result column="CARD_NO" property="cardNo"/> |
|
|
|
|
<result column="YP_CODE" property="ypCode"/> |
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
<resultMap id="statementExcelResultMap" type="org.springblade.desk.oem.pojo.excel.OemStatementExcel"> |
|
|
|
|
<result column="YP_CODE" property="ypCode"/> |
|
|
|
|
<result column="WO_CODE" property="woCode"/> |
|
|
|
|
<result column="PART_CODE" property="partCode"/> |
|
|
|
|
<result column="PART_NAME" property="partName"/> |
|
|
|
|
<result column="BATCH_NO" property="batchNo"/> |
|
|
|
|
<result column="PRODUCT_IDENT" property="productIdent"/> |
|
|
|
|
<result column="CARD_NO" property="cardNo"/> |
|
|
|
|
<result column="PS_NAME" property="psName"/> |
|
|
|
|
<result column="STATEMENT_CATEGORY" property="statementCategory"/> |
|
|
|
|
<result column="OC_CODE" property="ocCode"/> |
|
|
|
|
<result column="OC_NAME" property="ocName"/> |
|
|
|
|
<result column="MAKE_QTY" property="makeQty"/> |
|
|
|
|
<result column="YP_AREA" property="ypArea"/> |
|
|
|
|
<result column="TOTAL_AREA" property="totalArea"/> |
|
|
|
|
<result column="PLATE" property="plate"/> |
|
|
|
|
<result column="ROS_THICKNESS" property="rosThickness"/> |
|
|
|
|
<result column="STANDARD_PROCESS_CODE" property="standardProcessCode"/> |
|
|
|
|
<result column="TSB_NUM" property="tsbNum"/> |
|
|
|
|
<result column="TSD_NUM" property="tsdNum"/> |
|
|
|
|
<result column="TJT_NUM" property="tjtNum"/> |
|
|
|
|
<result column="PLAN_DEPTCODE" property="planDeptcode"/> |
|
|
|
|
<result column="USE_DEPT_CODE" property="useDeptCode"/> |
|
|
|
|
<result column="PUT_STORE_DATE" property="putStoreDate"/> |
|
|
|
|
<result column="ROS_STATUS_NAME" property="rosStatusName"/> |
|
|
|
|
</resultMap> |
|
|
|
|
<select id="exportOemStatement" resultType="org.springblade.desk.oem.pojo.excel.OemStatementExcel"> |
|
|
|
|
SELECT * |
|
|
|
|
FROM MES_OEM_STATEMENT ${ew.customSqlSegment} |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectUnsettled" resultMap="statementVOResultMap"> |
|
|
|
|
<select id="selectUnsettled" resultMap="StatementVOResultMap"> |
|
|
|
|
SELECT |
|
|
|
|
a.id AS WP_ID, |
|
|
|
|
a.wo_id, |
|
|
|
|
@ -218,7 +195,7 @@ |
|
|
|
|
AND os.ROS_STATUS = 4 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectOemStatementPage" resultMap="statementVOResultMap"> |
|
|
|
|
<select id="selectOemStatementPage" resultMap="StatementVOResultMap"> |
|
|
|
|
SELECT ID, |
|
|
|
|
YP_CODE, |
|
|
|
|
WO_CODE, |
|
|
|
|
@ -350,142 +327,8 @@ |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="exportOemStatement" resultMap="statementExcelResultMap"> |
|
|
|
|
SELECT ID, |
|
|
|
|
YP_CODE, |
|
|
|
|
WO_CODE, |
|
|
|
|
PART_ID, |
|
|
|
|
PART_CODE, |
|
|
|
|
PART_NAME, |
|
|
|
|
BATCH_NO, |
|
|
|
|
PRODUCT_IDENT, |
|
|
|
|
PPS_ID, |
|
|
|
|
PS_CODE, |
|
|
|
|
PS_NAME, |
|
|
|
|
CA_ID, |
|
|
|
|
CA_NAME, |
|
|
|
|
OC_ID, |
|
|
|
|
OC_CODE, |
|
|
|
|
OC_NAME, |
|
|
|
|
MAKE_QTY, |
|
|
|
|
YP_AREA, |
|
|
|
|
MAKE_QTY * YP_AREA as TOTAL_AREA, |
|
|
|
|
PLATE, |
|
|
|
|
ROS_THICKNESS, |
|
|
|
|
STANDARD_PROCESS_CODE, |
|
|
|
|
TSB_NUM, |
|
|
|
|
TSD_NUM, |
|
|
|
|
TJT_NUM, |
|
|
|
|
PLAN_DEPTCODE, |
|
|
|
|
USE_DEPT_CODE, |
|
|
|
|
PUT_STORE_TIME, |
|
|
|
|
to_char(PUT_STORE_TIME, 'yyyy-MM-dd') as PUT_STORE_DATE, |
|
|
|
|
QUOTATION, |
|
|
|
|
UNIT, |
|
|
|
|
UNIT_PRICE, |
|
|
|
|
TOTAL_PRICE, |
|
|
|
|
CASE WHEN ROS_STATUS = 3 THEN MEMO ELSE NULL END as MEMO, |
|
|
|
|
to_char(SETTLE_TIME, 'yyyy-MM-dd') as SETTLE_DATE, |
|
|
|
|
ROS_STATUS, |
|
|
|
|
to_char(APPROVAL_TIME, 'yyyy-MM-dd') as APPROVAL_DATE, |
|
|
|
|
to_char(PUSH_TIME, 'yyyy-MM-dd') as PUSH_DATE, |
|
|
|
|
STATEMENT_NO, |
|
|
|
|
STATEMENT_CATEGORY_ID, |
|
|
|
|
STATEMENT_CATEGORY, |
|
|
|
|
CARD_NO, |
|
|
|
|
ROS_STATUS as ROS_STATUS_NAME |
|
|
|
|
FROM MES_OEM_STATEMENT |
|
|
|
|
<where> |
|
|
|
|
IS_DELETED = 0 |
|
|
|
|
<if test="rosStatusList != null and rosStatusList != ''"> |
|
|
|
|
AND ROS_STATUS IN |
|
|
|
|
<foreach collection="rosStatusList.split(',')" item="status" |
|
|
|
|
open="(" separator="," close=")" index="index"> |
|
|
|
|
#{status} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="memo != null and memo != ''"> |
|
|
|
|
AND MEMO IN |
|
|
|
|
<foreach collection="memo.split(';')" item="memo" open="(" separator="," close=")" index="index"> |
|
|
|
|
#{memo} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="postPlatingStorageTimeStart != null"> |
|
|
|
|
AND PUT_STORE_TIME >= #{postPlatingStorageTimeStart} |
|
|
|
|
</if> |
|
|
|
|
<if test="postPlatingStorageTimeEnd != null"> |
|
|
|
|
AND PUT_STORE_TIME < #{postPlatingStorageTimeEnd} + 1 |
|
|
|
|
</if> |
|
|
|
|
<if test="productIdent != null and productIdent != ''"> |
|
|
|
|
AND PRODUCT_IDENT LIKE CONCAT('%', CONCAT(#{productIdent}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="manual != null and manual != ''"> |
|
|
|
|
AND manual = #{manual} |
|
|
|
|
</if> |
|
|
|
|
<if test="caId != null and caId != ''"> |
|
|
|
|
AND CA_ID = #{caId} |
|
|
|
|
</if> |
|
|
|
|
<if test="ppsId != null and ppsId != ''"> |
|
|
|
|
AND PPS_ID = #{ppsId} |
|
|
|
|
</if> |
|
|
|
|
<if test="woCode != null and woCode != ''"> |
|
|
|
|
AND WO_CODE LIKE CONCAT('%', CONCAT(#{woCode}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="partCode != null and partCode != ''"> |
|
|
|
|
AND PART_CODE LIKE CONCAT('%', CONCAT(#{partCode}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="ypCode != null and ypCode != ''"> |
|
|
|
|
AND YP_CODE LIKE CONCAT('%', CONCAT(#{ypCode}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="batchNo != null and batchNo != ''"> |
|
|
|
|
AND BATCH_NO LIKE CONCAT('%', CONCAT(#{batchNo}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="plate != null and plate != ''"> |
|
|
|
|
AND PLATE LIKE CONCAT('%', CONCAT(#{plate}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="productIdent != null and productIdent != ''"> |
|
|
|
|
AND PRODUCT_IDENT LIKE CONCAT('%', CONCAT(#{productIdent}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="cardNo != null and cardNo != ''"> |
|
|
|
|
AND CARD_NO LIKE CONCAT('%', CONCAT(#{cardNo}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="statementCategoryId != null and statementCategoryId != ''"> |
|
|
|
|
AND STATEMENT_CATEGORY_ID = #{statementCategoryId} |
|
|
|
|
</if> |
|
|
|
|
<if test="statementCategory != null and statementCategory != ''"> |
|
|
|
|
AND STATEMENT_CATEGORY LIKE CONCAT('%', CONCAT(#{statementCategory}, '%')) |
|
|
|
|
</if> |
|
|
|
|
<if test="ocIds != null and ocIds != ''"> |
|
|
|
|
AND OC_ID IN |
|
|
|
|
<foreach collection="ocIds.split(',')" item="id" |
|
|
|
|
open="(" separator="," close=")" index="index"> |
|
|
|
|
#{id} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="psCode != null and psCode != ''"> |
|
|
|
|
AND ps_code IN |
|
|
|
|
<foreach collection="psCode.split(',')" item="id" |
|
|
|
|
open="(" separator="," close=")" index="index"> |
|
|
|
|
#{id} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
<choose> |
|
|
|
|
<when test="orderByField != null and orderByField != ''"> |
|
|
|
|
ORDER BY ${orderByField} |
|
|
|
|
<if test="isAsc">ASC</if> |
|
|
|
|
<if test="!isAsc">DESC</if> |
|
|
|
|
</when> |
|
|
|
|
<otherwise> |
|
|
|
|
order by PUT_STORE_TIME asc |
|
|
|
|
</otherwise> |
|
|
|
|
</choose> |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<!-- 查询结算异常数据(带关联字段) --> |
|
|
|
|
<select id="selectErrorStatements" resultMap="statementVOResultMap"> |
|
|
|
|
<select id="selectErrorStatements" resultMap="StatementVOResultMap"> |
|
|
|
|
SELECT |
|
|
|
|
h.ID, |
|
|
|
|
h.pps_id AS ps_id, |
|
|
|
|
@ -504,7 +347,7 @@ |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<!-- 查询订单数据错误的结算异常数据 --> |
|
|
|
|
<select id="selectOrderDataErrorStatements" resultMap="statementVOResultMap"> |
|
|
|
|
<select id="selectOrderDataErrorStatements" resultMap="StatementVOResultMap"> |
|
|
|
|
SELECT |
|
|
|
|
h.ID, |
|
|
|
|
h.WP_ID, |
|
|
|
|
@ -537,7 +380,7 @@ |
|
|
|
|
AND h.MEMO LIKE '%订单数据错误%' |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectUnsettledByMjMes" resultMap="statementVOResultMap"> |
|
|
|
|
<select id="selectUnsettledByMjMes" resultMap="StatementVOResultMap"> |
|
|
|
|
SELECT |
|
|
|
|
a.wp_id, |
|
|
|
|
a.wo_id, |
|
|
|
|
|