ConversationDateMapper.xml
2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?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="cn.com.glsx.dj.mindworkplate.mapper.ConversationDateMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.ConversationDate" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="audio_time" property="audioTime" jdbcType="DATE" />
<result column="badge_id" property="badgeId" jdbcType="VARCHAR" />
<result column="seconds" property="seconds" jdbcType="INTEGER" />
<result column="batch_num" property="batchNum" jdbcType="INTEGER" />
<result column="score" property="score" jdbcType="DECIMAL" />
<result column="enter_reception_batch" property="enterReceptionBatch" jdbcType="INTEGER" />
<result column="abnormal_proportion" property="abnormalProportion" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, audio_time, badge_id, seconds, batch_num, score, enter_reception_batch, abnormal_proportion,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<update id="increaseSeconds">
update inspection_conversation_date
set seconds = if(seconds is null, 0, seconds) + #{seconds}
where id = #{id}
</update>
<update id="staticBatchInfo">
<foreach collection="conversationDates" item="item" separator=";">
update inspection_conversation_date
<set>
<if test="item.batchNum != null ">
batch_num = #{item.batchNum},
</if>
<if test="item.score != null">
score = #{item.score}
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<select id="selectByBadgeAndDate" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from inspection_conversation_date
where badge_id = #{badgeId} and audio_time = cast(#{audioTime} as date)
</select>
<select id="selectUnInspectionList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from inspection_conversation_date
where deleted_flag = 'N'
and score is null
</select>
</mapper>