mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 18:19:36 +08:00
145 lines
6.9 KiB
XML
145 lines
6.9 KiB
XML
<?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="com.ics.admin.mapper.RepairRemindMapper">
|
|
|
|
<resultMap type="com.ics.admin.domain.RepairRemind" id="RepairRemindResult">
|
|
<result property="id" column="id" />
|
|
<result property="typeId" column="type_id" />
|
|
<result property="repairId" column="repair_id" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="content" column="content" />
|
|
<result property="read" column="read" />
|
|
<result property="readTime" column="readtime" />
|
|
<result property="ext1" column="ext1" />
|
|
<result property="ext2" column="ext2" />
|
|
<result property="ext3" column="ext3" />
|
|
<result property="deleteFlag" column="delete_flag" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="parkId" column="park_id" />
|
|
<result property="tenantId" column="tenant_id" />
|
|
</resultMap>
|
|
|
|
<sql id="selectRepairRemindVo">
|
|
SELECT id, type_id, repair_id, user_id, content, `read`, readtime, ext1, ext2, ext3, delete_flag, create_by, create_time, update_by, update_time, park_id, tenant_id FROM ics_repair_remind
|
|
</sql>
|
|
|
|
<select id="getRepairRemindByUserId" parameterType="RepairRemind" resultMap="RepairRemindResult">
|
|
<include refid="selectRepairRemindVo"/>
|
|
where user_id=#{userId} and delete_flag=0
|
|
<if test="read != null">
|
|
AND `read` = #{read}
|
|
</if>
|
|
order by `read` asc,create_time desc
|
|
</select>
|
|
|
|
<select id="getLatestRepairRemind" parameterType="RepairRemind" resultMap="RepairRemindResult">
|
|
<include refid="selectRepairRemindVo"/>
|
|
where user_id=#{userId} and delete_flag=0 and `read`=0 order by create_time desc limit #{number}
|
|
</select>
|
|
|
|
<select id="selectRepairRemindById" parameterType="Long" resultMap="RepairRemindResult">
|
|
<include refid="selectRepairRemindVo"/>
|
|
WHERE id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertRepairRemind" parameterType="RepairRemind" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO ics_repair_remind
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null ">id,</if>
|
|
<if test="typeId != null ">type_id,</if>
|
|
<if test="repairId != null ">repair_id,</if>
|
|
<if test="userId != null ">user_id,</if>
|
|
<if test="content != null and content != ''">content,</if>
|
|
<if test="read != null ">`read`,</if>
|
|
<if test="readTime != null ">readtime,</if>
|
|
<if test="ext1 != null and ext1 != ''">ext1,</if>
|
|
<if test="ext2 != null and ext2 != ''">ext2,</if>
|
|
<if test="ext3 != null and ext3 != ''">ext3,</if>
|
|
<if test="deleteFlag != null ">delete_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="parkId != null ">park_id,</if>
|
|
<if test="tenantId != null ">tenant_id,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null ">#{id},</if>
|
|
<if test="typeId != null ">#{typeId},</if>
|
|
<if test="repairId != null ">#{repairId},</if>
|
|
<if test="userId != null ">#{userId},</if>
|
|
<if test="content != null and content != ''">#{content},</if>
|
|
<if test="read != null ">#{read},</if>
|
|
<if test="readTime != null ">#{readTime},</if>
|
|
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
|
|
<if test="ext2 != null and ext2 != ''">#{ext2},</if>
|
|
<if test="ext3 != null and ext3 != ''">#{ext3},</if>
|
|
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
<if test="parkId != null ">#{parkId},</if>
|
|
<if test="tenantId != null ">#{tenantId},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRepairRemind" parameterType="RepairRemind">
|
|
UPDATE ics_repair_remind
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="typeId != null ">type_id = #{typeId},</if>
|
|
<if test="repairId != null ">repair_id = #{repairId},</if>
|
|
<if test="userId != null ">user_id = #{userId},</if>
|
|
<if test="content != null and content != ''">content = #{content},</if>
|
|
<if test="read != null ">`read` = #{read},</if>
|
|
<if test="readTime != null ">readtime = #{readTime},</if>
|
|
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
|
|
<if test="ext2 != null and ext2 != ''">ext2 = #{ext2},</if>
|
|
<if test="ext3 != null and ext3 != ''">ext3 = #{ext3},</if>
|
|
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
<if test="parkId != null ">park_id = #{parkId},</if>
|
|
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<update id="readRepairRemin" parameterType="RepairRemind">
|
|
<![CDATA[
|
|
update ics_repair_remind set `read` = 1, readtime = #{readTime}, update_time=#{updateTime}, update_by = #{updateBy} where delete_flag = 0 and id = #{id} and user_id = #{userId}
|
|
]]>
|
|
</update>
|
|
|
|
<delete id="deleteRepairRemindById">
|
|
<![CDATA[
|
|
DELETE FROM ics_repair_remind WHERE delete_flag = 0 and id = #{id} and user_id = #{userId}
|
|
]]>
|
|
</delete>
|
|
|
|
<delete id="deleteRepairRemindByUserId" parameterType="Long">
|
|
DELETE FROM ics_repair_remind where delete_flag = 0 and user_id = #{userId}
|
|
</delete>
|
|
|
|
<delete id="deleteRepairRemindByIds" parameterType="String">
|
|
DELETE FROM ics_repair_remind where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="getWxPushRepairRemind" parameterType="RepairRemind" resultMap="RepairRemindResult">
|
|
<include refid="selectRepairRemindVo"/>
|
|
where delete_flag=0 and ext1='1'
|
|
</select>
|
|
|
|
<update id="afterWxPush">
|
|
update ics_repair_remind set ext1 = #{state} where id in
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
|
|
|
|
</mapper> |