* @param inspection 巡检任务 | * @param inspection 巡检任务 | ||||
* @return 结果 | * @return 结果 | ||||
*/ | */ | ||||
int update(Inspection inspection); | |||||
int update(Inspection inspection); | |||||
int updateStatus(Inspection inspection); | |||||
int updateByPrimaryKeySelective(Inspection request); | int updateByPrimaryKeySelective(Inspection request); | ||||
log.info("修改inspection status 开始"); | log.info("修改inspection status 开始"); | ||||
inspectionUpdate.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode()); | inspectionUpdate.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode()); | ||||
inspectionUpdate.setUpdateTime(DateUtils.now()); | |||||
log.info("inspectionUpdate:{}", inspectionUpdate); | log.info("inspectionUpdate:{}", inspectionUpdate); | ||||
Integer count = inspectionMapper.updateById(inspectionUpdate); | |||||
Integer count = inspectionMapper.updateStatus(inspectionUpdate); | |||||
if (count <= 0) { | if (count <= 0) { | ||||
log.info("修改inspection status 失败"); | log.info("修改inspection status 失败"); | ||||
} else { | } else { |
where id = #{id} | where id = #{id} | ||||
</update> | </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 id="updateByPrimaryKeySelective" parameterType="com.tuoheng.admin.entity.Inspection"> | ||||
update th_inspection | update th_inspection | ||||
<set> | <set> |