|
|
@@ -1,29 +1,57 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.zd.chemical.mapper.HxpCabinetlockLogMapper">
|
|
|
|
|
|
<resultMap type="com.zd.chemical.domain.HxpCabinetlockLog" id="HxpCabinetlockLogResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="cabinetlockId" column="cabinetlock_id" />
|
|
|
- <result property="unLockTime" column="un_lock_time" />
|
|
|
- <result property="closeLockTime" column="close_lock_time" />
|
|
|
- <result property="operationType" column="operation_type" />
|
|
|
- <result property="unLockVideo" column="un_lock_video" />
|
|
|
- <result property="closeLockVideo" column="close_lock_video" />
|
|
|
- <result property="userIds" column="user_ids" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="cabinetlockId" column="cabinetlock_id"/>
|
|
|
+ <result property="unLockTime" column="un_lock_time"/>
|
|
|
+ <result property="closeLockTime" column="close_lock_time"/>
|
|
|
+ <result property="operationType" column="operation_type"/>
|
|
|
+ <result property="unLockVideo" column="un_lock_video"/>
|
|
|
+ <result property="closeLockVideo" column="close_lock_video"/>
|
|
|
+ <result property="userIds" column="user_ids"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+
|
|
|
+ <result property="stockId" column="stock_id"/>
|
|
|
+ <result property="userecordId" column="userecord_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectHxpCabinetlockLogVo">
|
|
|
- select id, cabinetlock_id, un_lock_time, close_lock_time, operation_type, un_lock_video, close_lock_video, user_ids, create_time, create_by from hxp_cabinetlock_log
|
|
|
+ select id,
|
|
|
+ cabinetlock_id,
|
|
|
+ un_lock_time,
|
|
|
+ close_lock_time,
|
|
|
+ operation_type,
|
|
|
+ un_lock_video,
|
|
|
+ close_lock_video,
|
|
|
+ user_ids,
|
|
|
+ create_time,
|
|
|
+ create_by,
|
|
|
+ stock_id,
|
|
|
+ userecord_id
|
|
|
+ from hxp_cabinetlock_log
|
|
|
</sql>
|
|
|
<sql id="selectHxpCabinetlockLogListVo">
|
|
|
- select t.id, t.cabinetlock_id, t.un_lock_time, t.close_lock_time, t.operation_type, t.un_lock_video, t.close_lock_video, t.user_ids, t.create_time, t.create_by from hxp_cabinetlock_log as t
|
|
|
+ select t.id,
|
|
|
+ t.cabinetlock_id,
|
|
|
+ t.un_lock_time,
|
|
|
+ t.close_lock_time,
|
|
|
+ t.operation_type,
|
|
|
+ t.un_lock_video,
|
|
|
+ t.close_lock_video,
|
|
|
+ t.user_ids,
|
|
|
+ t.create_time,
|
|
|
+ t.create_by,
|
|
|
+ t.stock_id,
|
|
|
+ t.userecord_id
|
|
|
+ from hxp_cabinetlock_log as t
|
|
|
</sql>
|
|
|
- <select id="selectHxpCabinetlockLogList" parameterType="com.zd.chemical.domain.vo.HxpCabinetlockLogSearch" resultType="com.zd.chemical.domain.vo.HxpCabinetlockLogVo">
|
|
|
+ <select id="selectHxpCabinetlockLogList" parameterType="com.zd.chemical.domain.vo.HxpCabinetlockLogSearch"
|
|
|
+ resultType="com.zd.chemical.domain.vo.HxpCabinetlockLogVo">
|
|
|
select DISTINCT
|
|
|
cl.un_lock_time unLockTime,
|
|
|
cl.close_lock_time closeLockTime,
|
|
|
@@ -41,9 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
end operationTypeContent,
|
|
|
cl.un_lock_video unLockVideo,
|
|
|
cl.close_lock_video closeLockVideo,
|
|
|
- (select group_concat(ur.nick_name SEPARATOR '、') from sys_user ur where find_in_set(ur.user_id, cl.user_ids)) operationNames
|
|
|
+ (select group_concat(ur.nick_name SEPARATOR '、') from sys_user ur where find_in_set(ur.user_id, cl.user_ids))
|
|
|
+ operationNames
|
|
|
from
|
|
|
- hxp_cabinetlock_log cl left join sys_user ur on FIND_IN_SET(ur.user_id, cl.user_ids)
|
|
|
+ hxp_cabinetlock_log cl left join sys_user ur on FIND_IN_SET(ur.user_id, cl.user_ids)
|
|
|
<where>
|
|
|
<if test="cabinetlockId != null ">
|
|
|
and cl.cabinetlock_id = #{cabinetlockId}
|
|
|
@@ -87,44 +116,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectByLockId" resultType="com.zd.chemical.domain.HxpCabinetlockLog">
|
|
|
<include refid="selectHxpCabinetlockLogVo"/>
|
|
|
where cabinetlock_id = (select id from lab_hardware where subject_id = #{subId} and lock_id = #{lockId} limit 1)
|
|
|
- and close_lock_video is null
|
|
|
+ and close_lock_video is null
|
|
|
order by create_time desc
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertHxpCabinetlockLog" parameterType="com.zd.chemical.domain.HxpCabinetlockLog" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <insert id="insertHxpCabinetlockLog" parameterType="com.zd.chemical.domain.HxpCabinetlockLog"
|
|
|
+ useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into hxp_cabinetlock_log
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="cabinetlockId != null">cabinetlock_id,</if>
|
|
|
+ <if test="cabinetlockId != null">cabinetlock_id,</if>
|
|
|
|
|
|
- <if test="unLockTime != null">un_lock_time,</if>
|
|
|
+ <if test="unLockTime != null">un_lock_time,</if>
|
|
|
|
|
|
- <if test="closeLockTime != null">close_lock_time,</if>
|
|
|
+ <if test="closeLockTime != null">close_lock_time,</if>
|
|
|
|
|
|
- <if test="operationType != null">operation_type,</if>
|
|
|
+ <if test="operationType != null">operation_type,</if>
|
|
|
|
|
|
- <if test="unLockVideo != null">un_lock_video,</if>
|
|
|
+ <if test="unLockVideo != null">un_lock_video,</if>
|
|
|
|
|
|
- <if test="closeLockVideo != null">close_lock_video,</if>
|
|
|
+ <if test="closeLockVideo != null">close_lock_video,</if>
|
|
|
|
|
|
- <if test="userIds != null">user_ids,</if>
|
|
|
+ <if test="userIds != null">user_ids,</if>
|
|
|
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
|
- <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
|
|
- </trim>
|
|
|
+ <if test="stockId != null">stock_id,</if>
|
|
|
+ <if test="userecordId != null">userecord_id,</if>
|
|
|
+
|
|
|
+
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="cabinetlockId != null">#{cabinetlockId},</if>
|
|
|
- <if test="unLockTime != null">#{unLockTime},</if>
|
|
|
- <if test="closeLockTime != null">#{closeLockTime},</if>
|
|
|
- <if test="operationType != null">#{operationType},</if>
|
|
|
- <if test="unLockVideo != null">#{unLockVideo},</if>
|
|
|
- <if test="closeLockVideo != null">#{closeLockVideo},</if>
|
|
|
- <if test="userIds != null">#{user_ids},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="createBy != null">#{createBy},</if>
|
|
|
- </trim>
|
|
|
+ <if test="cabinetlockId != null">#{cabinetlockId},</if>
|
|
|
+ <if test="unLockTime != null">#{unLockTime},</if>
|
|
|
+ <if test="closeLockTime != null">#{closeLockTime},</if>
|
|
|
+ <if test="operationType != null">#{operationType},</if>
|
|
|
+ <if test="unLockVideo != null">#{unLockVideo},</if>
|
|
|
+ <if test="closeLockVideo != null">#{closeLockVideo},</if>
|
|
|
+ <if test="userIds != null">#{user_ids},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="stockId != null">#{stockId},</if>
|
|
|
+ <if test="userecordId != null">#{userecordId},</if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateHxpCabinetlockLog" parameterType="com.zd.chemical.domain.HxpCabinetlockLog">
|
|
|
@@ -139,12 +175,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userIds != null">user_ids = #{userIds},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+
|
|
|
+ <if test="stockId != null">stock_id = #{stockId},</if>
|
|
|
+ <if test="userecordId != null">userecord_id = #{userecordId},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteHxpCabinetlockLogById">
|
|
|
- delete from hxp_cabinetlock_log where id = #{id}
|
|
|
+ delete
|
|
|
+ from hxp_cabinetlock_log
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteHxpCabinetlockLogByIds">
|