2025-12-18 14:55:21 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.bonus.digital.mapper.DayPlanMapper">
|
|
|
|
|
|
|
|
|
|
<insert id="addMonthlyPlan">
|
|
|
|
|
INSERT INTO tb_day_plan
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="dayPlan != null and dayPlan != ''">day_plan,</if>
|
|
|
|
|
<if test="plannedWorkload != null and plannedWorkload != ''">planned_workload,</if>
|
|
|
|
|
<if test="proposedPersonnel != null and proposedPersonnel != ''">proposed_personnel,</if>
|
|
|
|
|
<if test="proposedProficientPersonnel != null and proposedProficientPersonnel != ''">proposed_proficient_personnel,</if>
|
|
|
|
|
<if test="proposedProficientDay != null and proposedProficientDay != ''">proposed_proficient_day,</if>
|
|
|
|
|
<if test="proposedAssistancePersonnel != null and proposedAssistancePersonnel != ''">proposed_assistance_personnel,</if>
|
|
|
|
|
<if test="proposedAssistanceDay != null and proposedAssistanceDay != ''">proposed_assistance_day,</if>
|
|
|
|
|
<if test="proposedLongTimeCar != null and proposedLongTimeCar != ''">proposed_long_time_car,</if>
|
|
|
|
|
<if test="proposedTemporaryCar != null and proposedTemporaryCar != ''">proposed_temporary_car,</if>
|
|
|
|
|
<if test="proposedSubCar != null and proposedSubCar != ''">proposed_sub_car,</if>
|
|
|
|
|
<if test="actualProficientPersonnel != null and actualProficientPersonnel != ''">actual_proficient_personnel,</if>
|
|
|
|
|
<if test="actualAssistancePersonnel != null and actualAssistancePersonnel != ''">actual_assistance_personnel,</if>
|
|
|
|
|
<if test="actualPersonnel != null and actualPersonnel != ''">actual_personnel,</if>
|
|
|
|
|
<if test="actualLongTimeCar != null and actualLongTimeCar != ''">actual_long_time_car,</if>
|
|
|
|
|
<if test="actualTemporaryCar != null and actualTemporaryCar != ''">actual_temporary_car,</if>
|
|
|
|
|
<if test="actualSubCar != null and actualSubCar != ''">actual_sub_car,</if>
|
|
|
|
|
<if test="actualWorkContent != null and actualWorkContent != ''">actual_work_content,</if>
|
|
|
|
|
<if test="actualWorkload != null and actualWorkload != ''">actual_workload,</if>
|
|
|
|
|
<if test="completionPercentage != null and completionPercentage != ''">completion_percentage,</if>
|
|
|
|
|
<if test="planCompletionStatus != null and planCompletionStatus != ''">plan_completion_status,</if>
|
|
|
|
|
<if test="planChanges != null and planChanges != ''">plan_changes,</if>
|
|
|
|
|
<if test="createUser != null and createUser != ''">create_user,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="status != null and status != ''">status,</if>
|
2025-12-18 18:22:27 +08:00
|
|
|
<if test="dayPlanType != null and dayPlanType != ''">day_plan_type,</if>
|
2025-12-18 14:55:21 +08:00
|
|
|
</trim>
|
|
|
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="dayPlan != null and dayPlan != ''">#{dayPlan},</if>
|
|
|
|
|
<if test="plannedWorkload != null and plannedWorkload != ''">#{plannedWorkload},</if>
|
|
|
|
|
<if test="proposedPersonnel != null and proposedPersonnel != ''">#{proposedPersonnel},</if>
|
|
|
|
|
<if test="proposedProficientPersonnel != null and proposedProficientPersonnel != ''">#{proposedProficientPersonnel},</if>
|
|
|
|
|
<if test="proposedProficientDay != null and proposedProficientDay != ''">#{proposedProficientDay},</if>
|
|
|
|
|
<if test="proposedAssistancePersonnel != null and proposedAssistancePersonnel != ''">#{proposedAssistancePersonnel},</if>
|
|
|
|
|
<if test="proposedAssistanceDay != null and proposedAssistanceDay != ''">#{proposedAssistanceDay},</if>
|
|
|
|
|
<if test="proposedLongTimeCar != null and proposedLongTimeCar != ''">#{proposedLongTimeCar},</if>
|
|
|
|
|
<if test="proposedTemporaryCar != null and proposedTemporaryCar != ''">#{proposedTemporaryCar},</if>
|
|
|
|
|
<if test="proposedSubCar != null and proposedSubCar != ''">#{proposedSubCar},</if>
|
|
|
|
|
<if test="actualProficientPersonnel != null and actualProficientPersonnel != ''">#{actualProficientPersonnel},</if>
|
|
|
|
|
<if test="actualAssistancePersonnel != null and actualAssistancePersonnel != ''">#{actualAssistancePersonnel},</if>
|
|
|
|
|
<if test="actualPersonnel != null and actualPersonnel != ''">#{actualPersonnel},</if>
|
|
|
|
|
<if test="actualLongTimeCar != null and actualLongTimeCar != ''">#{actualLongTimeCar},</if>
|
|
|
|
|
<if test="actualTemporaryCar != null and actualTemporaryCar != ''">#{actualTemporaryCar},</if>
|
|
|
|
|
<if test="actualSubCar != null and actualSubCar != ''">#{actualSubCar},</if>
|
|
|
|
|
<if test="actualWorkContent != null and actualWorkContent != ''">#{actualWorkContent},</if>
|
|
|
|
|
<if test="actualWorkload != null and actualWorkload != ''">#{actualWorkload},</if>
|
|
|
|
|
<if test="completionPercentage != null and completionPercentage != ''">#{completionPercentage},</if>
|
|
|
|
|
<if test="planCompletionStatus != null and planCompletionStatus != ''">#{planCompletionStatus},</if>
|
|
|
|
|
<if test="planChanges != null and planChanges != ''">#{planChanges},</if>
|
|
|
|
|
<if test="createUser != null and createUser != ''">#{createUser},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
2025-12-18 18:22:27 +08:00
|
|
|
<if test="dayPlanType != null and dayPlanType != ''">#{dayPlanType},</if>
|
2025-12-18 14:55:21 +08:00
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateDayPlan">
|
|
|
|
|
UPDATE tb_day_plan
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="monthlyPlanId != null">monthly_plan_id = #{monthlyPlanId},</if>
|
|
|
|
|
<if test="dayPlan != null and dayPlan != ''">day_plan = #{dayPlan},</if>
|
|
|
|
|
<if test="plannedWorkload != null and plannedWorkload != ''">planned_workload = #{plannedWorkload},</if>
|
|
|
|
|
<if test="proposedPersonnel != null and proposedPersonnel != ''">proposed_personnel = #{proposedPersonnel},</if>
|
|
|
|
|
<if test="proposedProficientPersonnel != null and proposedProficientPersonnel != ''">proposed_proficient_personnel = #{proposedProficientPersonnel},</if>
|
|
|
|
|
<if test="proposedProficientDay != null and proposedProficientDay != ''">proposed_proficient_day = #{proposedProficientDay},</if>
|
|
|
|
|
<if test="proposedAssistancePersonnel != null and proposedAssistancePersonnel != ''">proposed_assistance_personnel = #{proposedAssistancePersonnel},</if>
|
|
|
|
|
<if test="proposedAssistanceDay != null and proposedAssistanceDay != ''">proposed_assistance_day = #{proposedAssistanceDay},</if>
|
|
|
|
|
<if test="proposedLongTimeCar != null and proposedLongTimeCar != ''">proposed_long_time_car = #{proposedLongTimeCar},</if>
|
|
|
|
|
<if test="proposedTemporaryCar != null and proposedTemporaryCar != ''">proposed_temporary_car = #{proposedTemporaryCar},</if>
|
|
|
|
|
<if test="proposedSubCar != null and proposedSubCar != ''">proposed_sub_car = #{proposedSubCar},</if>
|
|
|
|
|
<if test="actualProficientPersonnel != null and actualProficientPersonnel != ''">actual_proficient_personnel = #{actualProficientPersonnel},</if>
|
|
|
|
|
<if test="actualAssistancePersonnel != null and actualAssistancePersonnel != ''">actual_assistance_personnel = #{actualAssistancePersonnel},</if>
|
|
|
|
|
<if test="actualPersonnel != null and actualPersonnel != ''">actual_personnel = #{actualPersonnel},</if>
|
|
|
|
|
<if test="actualLongTimeCar != null and actualLongTimeCar != ''">actual_long_time_car = #{actualLongTimeCar},</if>
|
|
|
|
|
<if test="actualTemporaryCar != null and actualTemporaryCar != ''">actual_temporary_car = #{actualTemporaryCar},</if>
|
|
|
|
|
<if test="actualSubCar != null and actualSubCar != ''">actual_sub_car = #{actualSubCar},</if>
|
|
|
|
|
<if test="actualWorkContent != null and actualWorkContent != ''">actual_work_content = #{actualWorkContent},</if>
|
|
|
|
|
<if test="actualWorkload != null and actualWorkload != ''">actual_workload = #{actualWorkload},</if>
|
|
|
|
|
<if test="completionPercentage != null and completionPercentage != ''">completion_percentage = #{completionPercentage},</if>
|
|
|
|
|
<if test="planCompletionStatus != null and planCompletionStatus != ''">plan_completion_status = #{planCompletionStatus},</if>
|
|
|
|
|
<if test="planChanges != null and planChanges != ''">plan_changes = #{planChanges},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="updateUser != null and updateUser != ''">update_user = #{updateUser},</if>
|
|
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE day_plan_id = #{dayPlanId}
|
|
|
|
|
</update>
|
|
|
|
|
<delete id="delDayPlan">
|
|
|
|
|
update tb_day_plan set is_active = '0' where day_plan_id = #{dayPlanId}
|
|
|
|
|
</delete>
|
|
|
|
|
<select id="getDayPlanList" resultType="com.bonus.digital.dao.DayPlanVo">
|
|
|
|
|
SELECT
|
2025-12-18 18:22:27 +08:00
|
|
|
tdp.*
|
2025-12-18 14:55:21 +08:00
|
|
|
FROM
|
|
|
|
|
tb_day_plan tdp
|
|
|
|
|
LEFT JOIN tb_monthly_plan tmp ON tdp.monthly_plan_id = tmp.monthly_plan_id
|
|
|
|
|
LEFT JOIN tb_plan_management tpm ON tmp.plan_management_id = tpm.plan_management_id
|
2025-12-18 18:22:27 +08:00
|
|
|
WHERE
|
|
|
|
|
tdp.is_active = '1'
|
|
|
|
|
<if test="startTime != null and endTime != ''">
|
|
|
|
|
AND DATE_FORMAT( tdp.day_plan, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
|
|
|
|
</if>
|
2025-12-18 14:55:21 +08:00
|
|
|
</select>
|
|
|
|
|
</mapper>
|