外协结算

master
maxiangong 2 days ago
parent 7a037ea14f
commit 155f0bc501
  1. 9
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/oem/pojo/request/StatementQuery.java
  2. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/efficiency/mapper/SalaryStandardMapper.xml
  3. 112
      blade-service/blade-desk/src/main/java/org/springblade/desk/oem/mapper/OemStatementMapper.xml

@ -85,4 +85,13 @@ public class StatementQuery {
@Schema(description = "工序ID")
private Long ppsId;
/**
* 排序字段
*/
private String orderByField;
/**
* true: 升序false: 降序
*/
private boolean isAsc;
}

@ -182,9 +182,10 @@
ORDER BY ${bsSalaryStandard.orderByField}
<if test="bsSalaryStandard.isAsc">ASC</if>
<if test="!bsSalaryStandard.isAsc">DESC</if>
, minStep asc
</when>
<otherwise>
ORDER BY CREATE_TIME desc
ORDER BY CREATE_TIME desc, minStep asc
</otherwise>
</choose>
</select>

@ -189,91 +189,101 @@
<select id="selectOemStatementPage" resultMap="StatementVOResultMap">
SELECT
h.ID,
h.YP_CODE,
h.WO_CODE,
h.PART_ID,
h.PART_CODE,
h.PART_NAME,
h.BATCH_NO,
h.PRODUCT_IDENT,
h.PPS_ID,
H.PS_CODE,
h.PS_NAME,
h.CA_NAME,
h.OC_ID,
h.OC_CODE,
h.OC_NAME,
h.MAKE_QTY,
h.YP_AREA,
h.MAKE_QTY * h.YP_AREA as TOTAL_AREA,
h.PLATE,
h.ROS_THICKNESS,
h.STANDARD_PROCESS_CODE,
h.TSB_NUM,
h.TSD_NUM,
h.TJT_NUM,
h.PLAN_DEPTCODE,
h.USE_DEPT_CODE,
h.PUT_STORE_TIME,
to_char(h.PUT_STORE_TIME, 'yyyy-MM-dd') as PUT_STORE_DATE,
h.QUOTATION,
h.UNIT,
h.UNIT_PRICE,
h.TOTAL_PRICE,
CASE WHEN h.ROS_STATUS = 3 THEN h.MEMO ELSE NULL END as MEMO,
to_char(h.SETTLE_TIME, 'yyyy-MM-dd') as SETTLE_DATE,
h.ROS_STATUS,
to_char(h.APPROVAL_TIME, 'yyyy-MM-dd') as APPROVAL_DATE,
to_char(h.PUSH_TIME, 'yyyy-MM-dd') as PUSH_DATE,
h.STATEMENT_NO
FROM MES_OEM_STATEMENT h
ID,
YP_CODE,
WO_CODE,
PART_ID,
PART_CODE,
PART_NAME,
BATCH_NO,
PRODUCT_IDENT,
PPS_ID,
PS_CODE,
PS_NAME,
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
FROM MES_OEM_STATEMENT
<where>
h.IS_DELETED = 0
IS_DELETED = 0
<if test="query.rosStatusList != null and query.rosStatusList != ''">
AND h.ROS_STATUS IN
AND ROS_STATUS IN
<foreach collection="query.rosStatusList.split(',')" item="status"
open="(" separator="," close=")" index="index">
#{status}
</foreach>
</if>
<if test="query.postPlatingStorageTimeStart != null">
AND h.PUT_STORE_TIME &gt;= #{query.postPlatingStorageTimeStart}
AND PUT_STORE_TIME &gt;= #{query.postPlatingStorageTimeStart}
</if>
<if test="query.postPlatingStorageTimeEnd != null">
AND h.PUT_STORE_TIME &lt; #{query.postPlatingStorageTimeEnd} + 1
AND PUT_STORE_TIME &lt; #{query.postPlatingStorageTimeEnd} + 1
</if>
<if test="query.productIdent != null and query.productIdent != ''">
AND h.PRODUCT_IDENT = #{query.productIdent}
AND PRODUCT_IDENT = #{query.productIdent}
</if>
<if test="query.manual != null and query.manual != ''">
AND h.manual = #{query.manual}
AND manual = #{query.manual}
</if>
<if test="query.woCode != null and query.woCode != ''">
AND h.WO_CODE LIKE CONCAT('%', CONCAT(#{query.woCode}, '%'))
AND WO_CODE LIKE CONCAT('%', CONCAT(#{query.woCode}, '%'))
</if>
<if test="query.partCode != null and query.partCode != ''">
AND p.PART_CODE LIKE CONCAT('%', CONCAT(#{query.partCode}, '%'))
AND PART_CODE LIKE CONCAT('%', CONCAT(#{query.partCode}, '%'))
</if>
<if test="query.batchNo != null and query.batchNo != ''">
AND h.BATCH_NO LIKE CONCAT('%', CONCAT(#{query.batchNo}, '%'))
AND BATCH_NO LIKE CONCAT('%', CONCAT(#{query.batchNo}, '%'))
</if>
<if test="query.ocIds != null and query.ocIds != ''">
AND h.OC_ID IN
AND OC_ID IN
<foreach collection="query.ocIds.split(',')" item="id"
open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
<if test="query.psCode != null and query.psCode != ''">
AND h.ps_code IN
AND ps_code IN
<foreach collection="query.psCode.split(',')" item="id"
open="(" separator="," close=")" index="index">
#{id}
</foreach>
</if>
</where>
order by PUT_STORE_TIME desc
<choose>
<when test="query.orderByField != null and query.orderByField != ''">
ORDER BY ${query.orderByField}
<if test="query.isAsc">ASC</if>
<if test="!query.isAsc">DESC</if>
</when>
<otherwise>
order by PUT_STORE_TIME asc
</otherwise>
</choose>
</select>
<!-- 查询结算异常数据(带关联字段) -->

Loading…
Cancel
Save