|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ktg.iscs.mapper.IsMaterialsReminderMapper">
|
|
<mapper namespace="com.ktg.iscs.mapper.IsMaterialsReminderMapper">
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<resultMap type="IsMaterialsReminder" id="IsMaterialsReminderResult">
|
|
<resultMap type="IsMaterialsReminder" id="IsMaterialsReminderResult">
|
|
|
<result property="recordId" column="record_id" />
|
|
<result property="recordId" column="record_id" />
|
|
|
<result property="materialsLoanId" column="materials_loan_id" />
|
|
<result property="materialsLoanId" column="materials_loan_id" />
|
|
@@ -23,18 +23,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectIsMaterialsReminderList" parameterType="IsMaterialsReminder" resultMap="IsMaterialsReminderResult">
|
|
<select id="selectIsMaterialsReminderList" parameterType="IsMaterialsReminder" resultMap="IsMaterialsReminderResult">
|
|
|
<include refid="selectIsMaterialsReminderVo"/>
|
|
<include refid="selectIsMaterialsReminderVo"/>
|
|
|
- <where>
|
|
|
|
|
|
|
+ <where>
|
|
|
<if test="materialsLoanId != null "> and materials_loan_id = #{materialsLoanId}</if>
|
|
<if test="materialsLoanId != null "> and materials_loan_id = #{materialsLoanId}</if>
|
|
|
<if test="reminderType != null "> and reminder_type = #{reminderType}</if>
|
|
<if test="reminderType != null "> and reminder_type = #{reminderType}</if>
|
|
|
<if test="readFlag != null "> and read_flag = #{readFlag}</if>
|
|
<if test="readFlag != null "> and read_flag = #{readFlag}</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<select id="selectIsMaterialsReminderByRecordId" parameterType="Long" resultMap="IsMaterialsReminderResult">
|
|
<select id="selectIsMaterialsReminderByRecordId" parameterType="Long" resultMap="IsMaterialsReminderResult">
|
|
|
<include refid="selectIsMaterialsReminderVo"/>
|
|
<include refid="selectIsMaterialsReminderVo"/>
|
|
|
where record_id = #{recordId}
|
|
where record_id = #{recordId}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<insert id="insertIsMaterialsReminder" parameterType="IsMaterialsReminder" useGeneratedKeys="true" keyProperty="recordId">
|
|
<insert id="insertIsMaterialsReminder" parameterType="IsMaterialsReminder" useGeneratedKeys="true" keyProperty="recordId">
|
|
|
insert into is_materials_reminder
|
|
insert into is_materials_reminder
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -82,9 +82,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteIsMaterialsReminderByRecordIds" parameterType="String">
|
|
<delete id="deleteIsMaterialsReminderByRecordIds" parameterType="String">
|
|
|
- delete from is_materials_reminder where record_id in
|
|
|
|
|
|
|
+ delete from is_materials_reminder where record_id in
|
|
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
|
|
#{recordId}
|
|
#{recordId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</delete>
|
|
</delete>
|
|
|
-</mapper>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="getIsMaterialsReminderPage"
|
|
|
|
|
+ resultType="com.ktg.iscs.domain.vo.materialsReminder.MaterialsReminderVO">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ r.*,
|
|
|
|
|
+ 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_reminder r
|
|
|
|
|
+ LEFT JOIN is_materials_loan l ON r.materials_loan_id = l.materials_loan_id
|
|
|
|
|
+ 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>
|
|
|
|
|
+ r.reminder_type = #{dto.reminderType}
|
|
|
|
|
+ <if test="dto.readFlag != null">
|
|
|
|
|
+ and r.read_lag = #{dto.readFlag}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <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 r.record_id DESC
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|