|
|
@@ -21,10 +21,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
+ <result property="actualRestitutionTime" column="actual_restitution_time" />
|
|
|
+ <result property="timeoutAlarm" column="timeout_alarm" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectIsMaterialsLoanVo">
|
|
|
- select materials_loan_id, materials_id, loan_user_id, loan_from_id, loan_time, reminder_time, restitution_user_id, restitution_to_id, restitution_time, remark, del_flag, create_by, create_time, update_time, update_by from is_materials_loan
|
|
|
+ select materials_loan_id, materials_id, loan_user_id, loan_from_id, loan_time, reminder_time, restitution_user_id,
|
|
|
+ restitution_to_id, restitution_time, remark, del_flag, create_by, create_time, update_time, update_by,
|
|
|
+ actual_restitution_time, timeout_alarm
|
|
|
+ from is_materials_loan
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectIsMaterialsLoanList" parameterType="IsMaterialsLoan" resultMap="IsMaterialsLoanResult">
|
|
|
@@ -64,6 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="actualRestitutionTime != null">actual_restitution_time,</if>
|
|
|
+ <if test="timeoutAlarm != null">timeout_alarm,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="materialsId != null">#{materialsId},</if>
|
|
|
@@ -81,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="actualRestitutionTime != null">#{actualRestitutionTime},</if>
|
|
|
+ <if test="timeoutAlarm != null">#{timeoutAlarm},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -102,6 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="actualRestitutionTime != null">actual_restitution_time = #{actualRestitutionTime},</if>
|
|
|
+ <if test="timeoutAlarm != null">timeout_alarm = #{timeoutAlarm},</if>
|
|
|
</trim>
|
|
|
where materials_loan_id = #{materialsLoanId}
|
|
|
</update>
|
|
|
@@ -153,4 +164,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
ORDER BY l.materials_loan_id DESC
|
|
|
</select>
|
|
|
+ <select id="getReturnReminderPage" resultType="com.ktg.iscs.domain.vo.materialsLoan.ReminderPageVO">
|
|
|
+ SELECT
|
|
|
+ l.*,
|
|
|
+ m.materials_code,
|
|
|
+ m.materials_name,
|
|
|
+ c1.cabinet_name as loan_from_name,
|
|
|
+ c2.cabinet_name as restitution_to_name,
|
|
|
+ u.user_name as loan_user_name
|
|
|
+ FROM
|
|
|
+ is_materials_loan l
|
|
|
+ LEFT JOIN is_materials m ON m.materials_id = l.materials_id
|
|
|
+ LEFT JOIN is_materials_cabinet c1 ON c1.cabinet_id = l.loan_from_id
|
|
|
+ LEFT JOIN is_materials_cabinet c2 ON c2.cabinet_id = l.restitution_to_id
|
|
|
+ LEFT JOIN sys_user u ON u.user_id = l.loan_user_id
|
|
|
+ <where>
|
|
|
+ l.reminder_time < NOW()
|
|
|
+ and NOW() < l.timeout_alarm
|
|
|
+ and actual_restitution_time is null
|
|
|
+ <if test="dto.materialsCode != null and dto.materialsCode.trim != ''">
|
|
|
+ and m.materials_code like concat('%',#{dto.materialsCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.materialsName != null and dto.materialsName.trim != ''">
|
|
|
+ and m.materials_name like concat('%',#{dto.materialsName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanUserName != null and dto.loanUserName.trim != ''">
|
|
|
+ and u.user_name like concat('%',#{dto.loanUserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanFromId != null">
|
|
|
+ and l.loan_from_id = #{dto.loanFromId}
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanFromName != null and dto.loanFromName.trim != ''">
|
|
|
+ and c1.cabinet_name like concat('%',#{dto.loanFromName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.startTime != null and dto.startTime.trim != ''">
|
|
|
+ and l.loan_time >= #{dto.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto.endTime != null and dto.endTime.trim != ''">
|
|
|
+ and l.loan_time <= #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY l.materials_loan_id DESC
|
|
|
+ </select>
|
|
|
+ <select id="getExpiredReminderPage" resultType="com.ktg.iscs.domain.vo.materialsLoan.ReminderPageVO">
|
|
|
+ SELECT
|
|
|
+ l.*,
|
|
|
+ m.materials_code,
|
|
|
+ m.materials_name,
|
|
|
+ c1.cabinet_name as loan_from_name,
|
|
|
+ c2.cabinet_name as restitution_to_name,
|
|
|
+ u.user_name as loan_user_name
|
|
|
+ FROM
|
|
|
+ is_materials_loan l
|
|
|
+ LEFT JOIN is_materials m ON m.materials_id = l.materials_id
|
|
|
+ LEFT JOIN is_materials_cabinet c1 ON c1.cabinet_id = l.loan_from_id
|
|
|
+ LEFT JOIN is_materials_cabinet c2 ON c2.cabinet_id = l.restitution_to_id
|
|
|
+ LEFT JOIN sys_user u ON u.user_id = l.loan_user_id
|
|
|
+ <where>
|
|
|
+ l.timeout_alarm < NOW()
|
|
|
+ and actual_restitution_time is null
|
|
|
+ <if test="dto.materialsCode != null and dto.materialsCode.trim != ''">
|
|
|
+ and m.materials_code like concat('%',#{dto.materialsCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.materialsName != null and dto.materialsName.trim != ''">
|
|
|
+ and m.materials_name like concat('%',#{dto.materialsName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanUserName != null and dto.loanUserName.trim != ''">
|
|
|
+ and u.user_name like concat('%',#{dto.loanUserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanFromId != null">
|
|
|
+ and l.loan_from_id = #{dto.loanFromId}
|
|
|
+ </if>
|
|
|
+ <if test="dto.loanFromName != null and dto.loanFromName.trim != ''">
|
|
|
+ and c1.cabinet_name like concat('%',#{dto.loanFromName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.startTime != null and dto.startTime.trim != ''">
|
|
|
+ and l.timeout_alarm >= #{dto.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto.endTime != null and dto.endTime.trim != ''">
|
|
|
+ and l.timeout_alarm <= #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY l.materials_loan_id DESC
|
|
|
+ </select>
|
|
|
</mapper>
|