单个三表一册更新

This commit is contained in:
方亮 2025-10-24 14:05:49 +08:00
parent f556f36c71
commit 3224dcca2c
3 changed files with 10 additions and 3 deletions

View File

@ -88,7 +88,7 @@ public interface WorkerJobMapper {
*/ */
boolean getThreeTableOneRosterDataByLastMonth(String string); boolean getThreeTableOneRosterDataByLastMonth(String string);
void deleteWorkerPay(String lastMonth); void deleteWorkerPay(@Param("lastMonth") String lastMonth, @Param("proId") String proId);
List<AttProMonthPo> getProMonthData(String lastMonth); List<AttProMonthPo> getProMonthData(String lastMonth);

View File

@ -72,6 +72,10 @@ public class ThreeTableOneRosterTask {
//查询所有有人在场的工程 //查询所有有人在场的工程
List<MapBeanVo> listPro = mapper.getAllPro(lastMonth.toString()); List<MapBeanVo> listPro = mapper.getAllPro(lastMonth.toString());
// List<MapBeanVo> listPro = new ArrayList<>();
// MapBeanVo aaa = new MapBeanVo();
// aaa.setId(60);
// listPro.add(aaa);
List<ThreeTableOneRosterPo> listRosterAll = new ArrayList<>(); List<ThreeTableOneRosterPo> listRosterAll = new ArrayList<>();
listPro.forEach(mapBeanVo -> { listPro.forEach(mapBeanVo -> {
//每个工程去循环生成 //每个工程去循环生成
@ -141,7 +145,7 @@ public class ThreeTableOneRosterTask {
if(!listRosterAll.isEmpty()){ if(!listRosterAll.isEmpty()){
//插入数据 //插入数据
if(isExist){ if(isExist){
mapper.deleteWorkerPay(lastMonth.toString()); mapper.deleteWorkerPay(lastMonth.toString(),"");
} }
mapper.insertWorkerPay(listRosterAll); mapper.insertWorkerPay(listRosterAll);
//获取整合数据 //获取整合数据
@ -271,7 +275,7 @@ public class ThreeTableOneRosterTask {
if(!listRosterAll.isEmpty()){ if(!listRosterAll.isEmpty()){
//插入数据 //插入数据
if(isExist){ if(isExist){
mapper.deleteWorkerPay(month); mapper.deleteWorkerPay(month, String.valueOf(proId));
} }
mapper.insertWorkerPay(listRosterAll); mapper.insertWorkerPay(listRosterAll);
//获取整合数据 //获取整合数据

View File

@ -310,6 +310,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteWorkerPay"> <delete id="deleteWorkerPay">
delete from tb_pro_month_table_roster where month = #{lastMonth} delete from tb_pro_month_table_roster where month = #{lastMonth}
<if test="proId != null and proId !=''">
and pro_id = #{proId}
</if>
</delete> </delete>
<select id="getProMonthData" resultType="com.bonus.job.domain.AttProMonthPo"> <select id="getProMonthData" resultType="com.bonus.job.domain.AttProMonthPo">