外协结算

liweidong
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") @Schema(description = "工序ID")
private Long ppsId; private Long ppsId;
/**
* 排序字段
*/
private String orderByField;
/**
* true: 升序false: 降序
*/
private boolean isAsc;
} }

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

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

Loading…
Cancel
Save