|
|
@@ -0,0 +1,92 @@
|
|
|
+<?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.dgtly.system.mapper.AlertUpvoteLogMapper">
|
|
|
+
|
|
|
+ <resultMap type="AlertUpvoteLog" id="AlertUpvoteLogResult">
|
|
|
+ <result property="alertUpvoteId" column="alert_upvote_id" />
|
|
|
+ <result property="alertId" column="alert_id" />
|
|
|
+ <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="isDelete" column="is_delete" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectAlertUpvoteLogVo">
|
|
|
+ select alert_upvote_id, alert_id, create_by, create_time, update_by, update_time, is_delete, user_id, status from alert_upvote_log
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectAlertUpvoteLogList" parameterType="AlertUpvoteLog" resultMap="AlertUpvoteLogResult">
|
|
|
+ <include refid="selectAlertUpvoteLogVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="alertId != null "> and alert_id = #{alertId}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAlertUpvoteLogById" parameterType="Long" resultMap="AlertUpvoteLogResult">
|
|
|
+ <include refid="selectAlertUpvoteLogVo"/>
|
|
|
+ where alert_upvote_id = #{alertUpvoteId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertAlertUpvoteLog" parameterType="AlertUpvoteLog" useGeneratedKeys="true" keyProperty="alertUpvoteId">
|
|
|
+ insert into alert_upvote_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="alertId != null ">alert_id,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="createTime != null ">create_time,</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
+ <if test="updateTime != null ">update_time,</if>
|
|
|
+ <if test="isDelete != null ">is_delete,</if>
|
|
|
+ <if test="userId != null ">user_id,</if>
|
|
|
+ <if test="status != null ">status,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="alertId != null ">#{alertId},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="createTime != null ">#{createTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null ">#{updateTime},</if>
|
|
|
+ <if test="isDelete != null ">#{isDelete},</if>
|
|
|
+ <if test="userId != null ">#{userId},</if>
|
|
|
+ <if test="status != null ">#{status},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateAlertUpvoteLog" parameterType="AlertUpvoteLog">
|
|
|
+ update alert_upvote_log
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="alertId != null ">alert_id = #{alertId},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null ">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
+ <if test="isDelete != null ">is_delete = #{isDelete},</if>
|
|
|
+ <if test="userId != null ">user_id = #{userId},</if>
|
|
|
+ <if test="status != null ">status = #{status},</if>
|
|
|
+ </trim>
|
|
|
+ where alert_upvote_id = #{alertUpvoteId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteAlertUpvoteLogById" parameterType="Long">
|
|
|
+ delete from alert_upvote_log where alert_upvote_id = #{alertUpvoteId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteAlertUpvoteLogByIds" parameterType="String">
|
|
|
+ delete from alert_upvote_log where alert_upvote_id in
|
|
|
+ <foreach item="alertUpvoteId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{alertUpvoteId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectUpvoteByUidAndAid" parameterType="Long" resultMap="AlertUpvoteLogResult">
|
|
|
+ <include refid="selectAlertUpvoteLogVo"/>
|
|
|
+ where user_id = #{userId} and alert_id = #{alertId}
|
|
|
+ </select>
|
|
|
+</mapper>
|