|
@@ -12,7 +12,6 @@
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
- <result property="finishTime" column="finish_time"/>
|
|
|
<result property="duration" column="duration_"/>
|
|
|
<result property="durationStr" column="duration_str"/>
|
|
|
<result property="personName" column="person_name" />
|
|
@@ -22,6 +21,8 @@
|
|
|
<result property="personId" column="person_id" />
|
|
|
<result property="approvalPersonId" column="approval_person_id" />
|
|
|
<result property="approvalPersonName" column="approval_person_name" />
|
|
|
+ <result property="beginTime" column="begin_time" />
|
|
|
+ <result property="finishTime" column="finish_time"/>
|
|
|
</resultMap>
|
|
|
<insert id="insert" parameterType="com.jpsoft.shinestar.modules.base.entity.WorkOverPerson">
|
|
|
<!--
|
|
@@ -31,20 +32,22 @@
|
|
|
-->
|
|
|
<![CDATA[
|
|
|
insert into base_work_over_person
|
|
|
- (id_,person_popedom_id,work_over_id,create_by,create_time,update_by,update_time,del_flag,finish_time,duration_,duration_str)
|
|
|
+ (id_,person_popedom_id,work_over_id,create_by,create_time,update_by,update_time,del_flag,finish_time,
|
|
|
+ duration_,duration_str,begin_time)
|
|
|
values
|
|
|
(
|
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
-,#{personPopedomId,jdbcType=VARCHAR}
|
|
|
-,#{workOverId,jdbcType=VARCHAR}
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
-,#{finishTime,jdbcType=TIMESTAMP}
|
|
|
-,#{duration,jdbcType=INTEGER}
|
|
|
-,#{durationStr,jdbcType=VARCHAR}
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{personPopedomId,jdbcType=VARCHAR}
|
|
|
+ ,#{workOverId,jdbcType=VARCHAR}
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ ,#{finishTime,jdbcType=TIMESTAMP}
|
|
|
+ ,#{duration,jdbcType=INTEGER}
|
|
|
+ ,#{durationStr,jdbcType=VARCHAR}
|
|
|
+ ,#{beginTime,jdbcType= TIMESTAMP }
|
|
|
)
|
|
|
]]>
|
|
|
</insert>
|
|
@@ -84,6 +87,9 @@
|
|
|
<if test="durationStr!=null">
|
|
|
duration_str=#{durationStr,jdbcType=VARCHAR }
|
|
|
</if>
|
|
|
+ <if test="beginTime!=null">
|
|
|
+ begin_time=#{beginTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id_=#{id}
|
|
|
</update>
|
|
@@ -176,8 +182,8 @@
|
|
|
( c.hours_ , 0 ) as hours_
|
|
|
FROM
|
|
|
base_work_over_person a
|
|
|
- inner join base_person_popedom b on a.person_popedom_id = b.id_
|
|
|
- inner join base_work_over c on a.work_over_id = c.id_
|
|
|
+ inner join base_person_popedom b on a.person_popedom_id = b.id_
|
|
|
+ inner join base_work_over c on a.work_over_id = c.id_
|
|
|
where
|
|
|
b.person_id = #{personId}
|
|
|
and c.start_time>=#{startDate}
|
|
@@ -187,5 +193,23 @@
|
|
|
and c.del_flag = 0
|
|
|
]]>
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="findByPersonIdAndOffsetMinute" resultMap="WorkOverPersonMap">
|
|
|
+ <![CDATA[
|
|
|
+ SELECT
|
|
|
+ a.*,
|
|
|
+ c.start_time,
|
|
|
+ c.end_time
|
|
|
+ FROM
|
|
|
+ base_work_over_person a
|
|
|
+ inner join base_person_popedom b on a.person_popedom_id = b.id_
|
|
|
+ inner join base_work_over c on a.work_over_id = c.id_
|
|
|
+ where
|
|
|
+ b.person_id = #{personId}
|
|
|
+ and date_add(c.start_time,interval ${earlyMinutes} minute)<=#{recordTime}
|
|
|
+ and date_add(c.end_time,interval ${delayMinutes} minute)>=#{recordTime}
|
|
|
+ and (c.status_='1' or c.status_ = '4')
|
|
|
+ and a.del_flag=0
|
|
|
+ and c.del_flag = 0
|
|
|
+ ]]>
|
|
|
+ </select>
|
|
|
</mapper>
|