From 3c046f5ee6256de9c33e16bd6363c735ca19795a Mon Sep 17 00:00:00 2001 From: jiask <1069621233@qq.com> Date: Thu, 5 Feb 2026 17:01:09 +0800 Subject: [PATCH] =?UTF-8?q?jsk=20=20=E6=95=B0=E6=8D=AE=E6=A6=82=E8=A7=88?= =?UTF-8?q?=20=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/index/IndexHomeDetailsMapper.xml | 1294 ++++++++++------- .../classes/mybatis/index/IndexHomeMapper.xml | 977 ++++++------- 2 files changed, 1203 insertions(+), 1068 deletions(-) diff --git a/build/classes/mybatis/index/IndexHomeDetailsMapper.xml b/build/classes/mybatis/index/IndexHomeDetailsMapper.xml index d945984..140ebdc 100644 --- a/build/classes/mybatis/index/IndexHomeDetailsMapper.xml +++ b/build/classes/mybatis/index/IndexHomeDetailsMapper.xml @@ -3,280 +3,290 @@ - - + + - - - + + + - - + + - + - + - - - + + + - + - + - - + + - + - - + + - - + + - + - - + + - + - + - - + + - + - + - + - + - - + + - - + + + - + - - + + - + - - + + - + - + - + - + SELECT - '车辆需求计划' as type, - cpd.id, - bp.`NAME` as projectName, - cpd.model_id modelId, - cpd.need_num needNum, - cpd.need_day needDay, - cpd.back_date backDate, - cpd.remark, - cmti.type maType, - cmti.`NAME` maName, - cmti.model maModel, - cmti.unit maUnit + '车辆需求计划' as type, + cpd.id, + bp.`NAME` as projectName, + cpd.model_id modelId, + cpd.need_num needNum, + cpd.need_day needDay, + cpa.need_time backDate, + cpd.remark, + cmti.type maType, + cmti.`NAME` maName, + cmti.model maModel, + cmti.unit maUnit FROM - car_plan_details cpd - LEFT JOIN car_plan_apply cpa ON cpd.apply_id = cpa.id - LEFT JOIN bm_project bp ON cpa.pro_id = bp.ID - LEFT JOIN car_ma_type_info cmti ON cpd.model_id = cmti.id + car_plan_details cpd + LEFT JOIN car_plan_apply cpa ON cpd.apply_id = cpa.id + LEFT JOIN bm_project bp ON cpa.pro_id = bp.ID + LEFT JOIN car_ma_type_info cmti ON cpd.model_id = cmti.id WHERE bp.`NAME` IS NOT NULL + and cpa.status = 2 + and cpa.dispatch_num = 0 + and cpa.status_type = 1 and bp.`NAME` like concat('%', #{projectName}, '%') @@ -1364,7 +1529,7 @@ spd.model_id AS modelId, spd.need_num AS needNum, spd.need_day AS needDay, - spd.back_date AS backDate, + spa.need_time AS backDate, spd.remark, spd.type maType, spd.`name` maName, @@ -1374,6 +1539,9 @@ LEFT JOIN st_plan_apply spa ON spd.apply_id = spa.id LEFT JOIN bm_project bp ON spa.project_id = bp.ID WHERE bp.`NAME` IS NOT NULL + and spa.status = 2 + and spa.ck_num = 0 + and spa.status_type = 1 and bp.`NAME` like concat('%', #{projectName}, '%') @@ -1390,7 +1558,7 @@ tpd.model_id moduleId, tpd.need_num needNum, tpd.need_day needDay, - tpd.back_date backDate, + tpa.need_time backDate, tpd.remark, tpd.type maType, tpd.`NAME` maName, @@ -1401,8 +1569,10 @@ LEFT JOIN t_plan_apply tpa on tpa.id=tpd.apply_id LEFT JOIN bm_project pro on tpa.project_id=pro.ID WHERE pro.`NAME` is not null + and tpa.status = 2 + and tpa.status_type = 1 and tpd.`NAME` like concat('%', #{maName}, '%') - \ No newline at end of file + diff --git a/build/classes/mybatis/index/IndexHomeMapper.xml b/build/classes/mybatis/index/IndexHomeMapper.xml index 0b8fc04..2fe94b1 100644 --- a/build/classes/mybatis/index/IndexHomeMapper.xml +++ b/build/classes/mybatis/index/IndexHomeMapper.xml @@ -3,14 +3,14 @@ - - - - - - - - + + + + + + + + @@ -27,18 +27,18 @@ - - - - + + + + - - - + + + - - - + + + @@ -51,40 +51,40 @@ - + - - + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - + - + - + - + - + - - + + - - - + SELECT + SUM( projectCount ) projectCount, + SUM( equipmentTypes ) equipmentTypes, + SUM( totalCount ) totalCount, + SUM( stockCount ) stockCount, + SUM( inUseCount ) inUseCount, + SUM( repairCount ) repairCount, + SUM( scrappedCount ) scrappedCount + FROM + ( + SELECT + COUNT( DISTINCT bp.ID ) AS projectCount, + 0 AS equipmentTypes, + 0 AS totalCount, + 0 AS stockCount, + 0 AS inUseCount, + 0 AS repairCount, + 0 AS scrappedCount + FROM + bm_project bp + WHERE + bp.IS_ACTIVE = 1 UNION + SELECT + 0 AS projectCount, + COUNT( DISTINCT mt.ID ) AS equipmentTypes, + 0 AS totalCount, + 0 AS stockCount, + 0 AS inUseCount, + 0 AS repairCount, + 0 AS scrappedCount + FROM + mm_type mt + WHERE + mt.`LEVEL` = 4 + AND mt.IS_ACTIVE = 1 UNION + SELECT + 0 AS projectCount, + 0 AS equipmentTypes, + sum( maTotal ) AS totalCount, + sum( storageNum ) AS stockCount, + SUM( inuseNum ) AS inUseCount, + SUM( repairNum ) AS repairCount, + SUM( scrapNum ) AS scrappedCount + FROM + ( + SELECT + rs.typeId, + mat2.`NAME` maType, + mat1.`NAME` maName, + mat1.UNIT AS maUnit, + SUM( rs.storageNum )+ SUM( rs.inuseNum ) + SUM( rs.repairNum ) AS maTotal, + SUM( rs.storageNum ) storageNum, + SUM( rs.inuseNum ) inuseNum, + SUM( rs.repairNum ) repairNum, + SUM( rs.scrapNum ) scrapNum, + SUM( rs.projectNum ) projectNum, + SUM( rs.inuseCount ) inuseCount, + SUM( rs.backCount ) backCount, + SUM( rs.pyNum ) AS pyNum, + SUM( rs.pkNum ) AS pkNum, + rs.isCount + FROM + ( + SELECT + mat1.ID AS typeId, + mat1.NUM storageNum, + 0 inuseNum, + 0 repairNum, + 0 scrapNum, + 0 projectNum, + 0 inuseCount, + 0 backCount, + 0 AS pyNum, + 0 AS pkNum, + mat1.IS_COUNT AS isCount + FROM + mm_type mat1 + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + LEFT JOIN mm_type mat3 ON mat3.ID = mat2.PARENT_ID + WHERE + mat1.`LEVEL` = 4 + AND mat1.IS_ACTIVE = '1' + GROUP BY + mat1.ID UNION + SELECT + typeId, + 0 storageNum, + sum( leaseNum ) - SUM( backNum ) inuseNum, + 0 repairNum, + 0 scrapNum, + 0 projectNum, + sum( leaseNum ) inuseCount, + SUM( backNum ) backCount, + 0 AS pyNum, + 0 AS pkNum, + isCount AS isCount + FROM + ( + SELECT + mmt1.`NAME` AS pMachineName, + mmt.`NAME` AS machineName, + mt.`NAME` AS machineModel, + mt.ID AS typeId, + mt.BUY_PRICE AS buyPrice, + mt.UNIT, + SUM( wir.NUM ) AS leaseNum, + 0 AS backNum, + mt.IS_COUNT AS isCount + FROM + wf_info_record wir + LEFT JOIN wf_task_record wtr ON wir.SUP_ID = wtr.ID + LEFT JOIN wf_task_record wtr2 ON wtr.SUP_ID = wtr2.ID + LEFT JOIN mm_type mt ON wir.MODEL_ID = mt.ID + LEFT JOIN mm_type mmt ON mt.PARENT_ID = mmt.ID + LEFT JOIN mm_type mmt1 ON mmt.PARENT_ID = mmt1.ID + LEFT JOIN wf_collar_details wcd ON wcd.TASK_ID = wtr.SUP_ID + AND wcd.MODEL_ID = wir.MODEL_ID + WHERE + wir.TYPE = 2 + AND wtr2.IS_ACTIVE = 1 + AND wcd.IS_APPROVAL = 1 + GROUP BY + mt.ID UNION + SELECT + mmt1.`NAME` AS pMachineName, + mmt.`NAME` AS machineName, + mt.`NAME` AS machineModel, + mt.ID AS typeId, + mt.BUY_PRICE AS buyPrice, + mt.UNIT, + 0 AS leaseNum, + SUM( wir.NUM ) AS backNum, + mt.IS_COUNT AS isCount + FROM + wf_info_record wir + LEFT JOIN wf_return_material_details wrd ON wir.SUP_ID = wrd.ID + LEFT JOIN wf_task_record wtr ON wrd.TASK_ID = wtr.ID + LEFT JOIN mm_type mt ON wir.MODEL_ID = mt.ID + LEFT JOIN mm_type mmt ON mt.PARENT_ID = mmt.ID + LEFT JOIN mm_type mmt1 ON mmt.PARENT_ID = mmt1.ID + WHERE + wir.TYPE = 4 + AND wtr.IS_ACTIVE = 1 + GROUP BY + mt.ID + ) a + GROUP BY + typeId UNION + SELECT + typeId, + 0 storageNum, + 0 inuseNum, + SUM( repairNum ) + SUM( checkNum ) + SUM( waitInputNum ) AS repairNum, + 0 scrapNum, + 0 projectNum, + 0 inuseCount, + 0 backCount, + 0 AS pyNum, + 0 AS pkNum, + isCount + FROM + ( + SELECT + mat1.ID AS typeId, + 0 storageNum, + 0 leaseNum, + SUM( wrd.REPAIR_NUM ) - SUM( wrd.ALREPAIR_NUM ) - SUM( SCRAP_NUM ) AS repairNum, + 0 checkNum, + 0 scrapNum, + 0 loseNum, + 0 waitInputNum, + mat1.IS_COUNT AS isCount + FROM + wf_repair_details wrd + LEFT JOIN mm_type mat1 ON wrd.MODEL_ID = mat1.ID + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + LEFT JOIN mm_type mat3 ON mat3.ID = mat2.PARENT_ID + GROUP BY + wrd.MODEL_ID UNION + SELECT + mat1.ID AS typeId, + 0 storageNum, + 0 leaseNum, + 0 repairNum, + SUM( wrc.CHECK_NUM ) - SUM( wrc.ALCHECK_NUM ) AS checkNum, + 0 scrapNum, + 0 loseNum, + 0 waitInputNum, + mat1.IS_COUNT AS isCount + FROM + wf_repair_check wrc + LEFT JOIN mm_type mat1 ON wrc.MODEL_ID = mat1.ID + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + LEFT JOIN mm_type mat3 ON mat3.ID = mat2.PARENT_ID + GROUP BY + wrc.MODEL_ID UNION + SELECT DISTINCT + mat1.ID AS typeId, + 0 storageNum, + 0 leaseNum, + 0 repairNum, + 0 checkNum, + 0 AS scrapNum, + 0 loseNum, + SUM( + IFNULL( PRE_PUT_NUM, 0 )) - sum( + IFNULL( AL_PUT_NUM, 0 )) AS waitInputNum, + mat1.IS_COUNT AS isCount + FROM + wf_put_storage_details wpd + LEFT JOIN mm_type mat1 ON wpd.MODEL_ID = mat1.ID + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + LEFT JOIN mm_type mat3 ON mat3.ID = mat2.PARENT_ID + WHERE + wpd.IS_SURE = 0 + GROUP BY + wpd.MODEL_ID + ) res + GROUP BY + typeId UNION + SELECT + mat1.ID AS typeId, + 0 storageNum, + 0 inuseNum, + 0 AS repairNum, + SUM( wsd.ALSCRAP_NUM ) AS scrapNum, + 0 projectNum, + 0 inuseCount, + 0 backCount, + 0 AS pyNum, + 0 AS pkNum, + mat1.IS_COUNT AS isCount + FROM + wf_scrap_details wsd + LEFT JOIN mm_type mat1 ON wsd.MODEL_ID = mat1.ID + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + LEFT JOIN mm_type mat3 ON mat3.ID = mat2.PARENT_ID + WHERE + wsd.IS_SURE = 1 + GROUP BY + wsd.MODEL_ID UNION + SELECT + mps.type AS typeId, + 0 storageNum, + 0 inuseNum, + 0 AS repairNum, + 0 AS scrapNum, + COUNT( DISTINCT wla.PROJECT ) AS projectNum, + 0 inuseCount, + 0 backCount, + 0 AS pyNum, + 0 AS pkNum, + mat1.IS_COUNT AS isCount + FROM + ma_type_project_storage mps + LEFT JOIN wf_lease_agreement wla ON mps.agreement_id = wla.ID + LEFT JOIN mm_type mat1 ON mps.type = mat1.ID + WHERE + mps.`status` = 1 + GROUP BY + mps.type UNION + SELECT + typeId, + 0 storageNum, + 0 inuseNum, + 0 AS repairNum, + 0 AS scrapNum, + 0 AS projectNum, + 0 inuseCount, + 0 backCount, + SUM( pyNum ) AS pyNum, + SUM( pkNum ) AS pkNum, + isCount + FROM + ( + SELECT + mli.TYPE_ID AS typeId, + mli.IS_PROFIT AS type, + IF + ( mli.IS_PROFIT = 1, SUM( mli.IN_NUMS ), 0 ) AS pyNum, + IF + ( mli.IS_PROFIT = 0, SUM( mli.IN_NUMS ), 0 ) AS pkNum, + mat1.IS_COUNT AS isCount + FROM + ma_lib_inventroy mli + LEFT JOIN mm_type mat1 ON mli.TYPE_ID = mat1.ID + GROUP BY + mli.TYPE_ID, + mli.IS_PROFIT + ) res + GROUP BY + typeId + ) rs + LEFT JOIN mm_type mat1 ON rs.typeId = mat1.ID + LEFT JOIN mm_type mat2 ON mat2.ID = mat1.PARENT_ID + GROUP BY + rs.typeId + ) a + WHERE + typeId IN ( SELECT DISTINCT mt.ID FROM mm_type mt WHERE mt.`LEVEL` = 4 AND mt.IS_ACTIVE = 1 ) + ) rs + + + + + insert into index_part_one(projectNum,maTypeNum,maTotalNum,maStorageNum,maUseNum,maRepairNum,maScrapNum,time) values (#{projectCount},#{equipmentTypes},#{totalCount},#{stockCount},#{inUseCount},#{repairCount},#{scrappedCount},#{time}) - - - - + + + + - + - - + + insert into index_part_two(newInputNum,repairInputNum,bdInputNum,backInputNum,total,slInputNum,bmInputNum,totalNum,time) values (#{newStorage.value},#{repairStorage.value},#{inventoryStorage.value},#{returnStorage.value},#{newStorage.total},#{equipmentCount.value},#{deviceCount.value},#{equipmentCount.total},#{time}) - - + + - - + + - - + + DELETE FROM pm_user_resourse - + where user_id = #{userId} - - + + insert into pm_user_resourse (user_id,resourse_id) values (#{userId},#{rsId}) - + - - \ No newline at end of file + +