@@ -47,7 +47,9 @@ public interface InspectionMapper extends BaseMapper<Inspection> { | |||
* @param inspection 巡检任务 | |||
* @return 结果 | |||
*/ | |||
int update(Inspection inspection); | |||
int update(Inspection inspection); | |||
int updateStatus(Inspection inspection); | |||
int updateByPrimaryKeySelective(Inspection request); | |||
@@ -66,8 +66,9 @@ public class UpdateFlightStatusService { | |||
log.info("修改inspection status 开始"); | |||
inspectionUpdate.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode()); | |||
inspectionUpdate.setUpdateTime(DateUtils.now()); | |||
log.info("inspectionUpdate:{}", inspectionUpdate); | |||
Integer count = inspectionMapper.updateById(inspectionUpdate); | |||
Integer count = inspectionMapper.updateStatus(inspectionUpdate); | |||
if (count <= 0) { | |||
log.info("修改inspection status 失败"); | |||
} else { |
@@ -188,6 +188,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
where id = #{id} | |||
</update> | |||
<update id="updateStatus" parameterType="com.tuoheng.admin.entity.Inspection"> | |||
update th_inspection | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser},</if> | |||
<if test="updateTime != null and updateTime != ''"> update_time = #{updateTime},</if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
<update id="updateByPrimaryKeySelective" parameterType="com.tuoheng.admin.entity.Inspection"> | |||
update th_inspection | |||
<set> |