parent
887c11a9c8
commit
d90f961ea5
|
@ -53,4 +53,11 @@ public interface TaskInfoMapper extends Mapper<TaskInfo>, MySqlMapper<TaskInfo>
|
|||
*/
|
||||
void changeTaskInfoStatus(@Param("id") Long id,
|
||||
@Param("status") Long status);
|
||||
|
||||
/**
|
||||
* get task info status.
|
||||
*
|
||||
* @param id the id
|
||||
*/
|
||||
int getTaskInfoCurrentStatus(Long id);
|
||||
}
|
||||
|
|
|
@ -28,4 +28,10 @@
|
|||
id = #{id, jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
<select id="getTaskInfoCurrentStatus" resultType="java.lang.Integer">
|
||||
SELECT status
|
||||
FROM task_info
|
||||
WHERE id = #{id, jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -162,22 +162,17 @@ public class TaskInfoMapperTest extends InitTestEnvironment {
|
|||
) {
|
||||
Assert.assertNotNull(taskInfo.getStatus());
|
||||
Long beforeStatus = taskInfo.getStatus();
|
||||
long changeStatus;
|
||||
if(beforeStatus == 0){
|
||||
long changeStatus = 0;
|
||||
if (beforeStatus == 0) {
|
||||
changeStatus = 1L;
|
||||
}else{
|
||||
changeStatus = 0L;
|
||||
}
|
||||
|
||||
log.info("task_info table Id-->{}, before Status-->{}, change Stauts-->{}",
|
||||
taskInfo.getId(),taskInfo.getStatus(),changeStatus);
|
||||
taskInfo.getId(), taskInfo.getStatus(), changeStatus);
|
||||
|
||||
taskInfoMapper.changeTaskInfoStatus(taskInfo.getId(), changeStatus);
|
||||
log.info("task_info before Status-->{}, after Stauts-->{}",
|
||||
beforeStatus, taskInfo.getStatus());
|
||||
Assert.assertEquals(beforeStatus, taskInfo.getStatus());
|
||||
|
||||
log.info("change task info Status-->{}", taskInfo.getStatus());
|
||||
Assert.assertNotEquals(beforeStatus, new Long((long) taskInfoMapper.getTaskInfoCurrentStatus(taskInfo.getId())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue