|
@@ -26,35 +26,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select alert_upvote_id, alert_id, create_by, create_time, update_by, update_time, is_delete, user_id, status,login_name,user_name,alert_content,photo_url from alert_upvote_log
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectAlertUpvoteLogList" parameterType="AlertUpvoteLog" resultMap="AlertUpvoteLogResult">
|
|
|
- select alert_upvote_id,
|
|
|
- alert_id,
|
|
|
- create_by,
|
|
|
- create_time,
|
|
|
- update_by,
|
|
|
- update_time,
|
|
|
- is_delete,
|
|
|
- user_id,
|
|
|
- status,
|
|
|
- login_name,
|
|
|
- user_name,
|
|
|
- IF(alert_content!='null', alert_content, "") alert_content,
|
|
|
- photo_url,
|
|
|
+ <select id="selectAlertUpvoteLogList" resultType="com.dgtly.system.domain.AlertUpvoteLog">
|
|
|
+ select aul.alert_upvote_id as alertUpvoteId,
|
|
|
+ aul.alert_id as alertId,
|
|
|
+ aul.create_time as createTime,
|
|
|
+ aul.user_id as userId,
|
|
|
+ aul.status as status,
|
|
|
+ su.login_name as loginName,
|
|
|
+ su.user_name as userName,
|
|
|
+ sue.sap_employee_id as sapEmployeeId,
|
|
|
+ sue.org_name as orgName,
|
|
|
+ sue.post_name as postName,
|
|
|
+ ac.alert_content as alertContent,
|
|
|
+ ac.photo_url as photoUrl,
|
|
|
+ ac.alert_title as alertTitle,
|
|
|
CASE
|
|
|
- WHEN status = '0' THEN '无'
|
|
|
- WHEN status = '1' THEN '赞'
|
|
|
- WHEN status = '2' THEN '踩'
|
|
|
+ WHEN aul.status = '0' THEN '无'
|
|
|
+ WHEN aul.status = '1' THEN '赞'
|
|
|
+ WHEN aul.status = '2' THEN '踩'
|
|
|
END statusName
|
|
|
- from alert_upvote_log
|
|
|
- <where>
|
|
|
- <if test="userName != null "> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
- <if test="loginName != null "> and login_name like concat('%', #{loginName}, '%')</if>
|
|
|
- <if test="alertContent != null "> and alert_content like concat('%', #{alertContent}, '%')</if>
|
|
|
- <if test="status != null "> and status = #{status}</if>
|
|
|
- <if test="startTime != null "> and create_time >= #{startTime}</if>
|
|
|
- <if test="endTime != null "> and create_time < #{endTime}</if>
|
|
|
- </where>
|
|
|
- order by create_time desc
|
|
|
+ from alert_upvote_log aul
|
|
|
+ left join alert_configuration ac on ac.alert_id=aul.alert_id
|
|
|
+ left join sys_user su on su.user_id=aul.user_id
|
|
|
+ left join sys_user_ext sue on sue.user_id=aul.user_id
|
|
|
+ where aul.status != '0'
|
|
|
+ <if test="userName != null and userName != ''"> and su.user_name like concat('%', #{userName}, '%')</if>
|
|
|
+ <if test="loginName != null and loginName != '' "> and su.login_name like concat('%', #{loginName}, '%')</if>
|
|
|
+ <if test="alertContent != null and alertContent != '' "> and ac.alert_content like concat('%', #{alertContent}, '%')</if>
|
|
|
+ <if test="status != null"> and aul.status = #{status}</if>
|
|
|
+ <if test="startTime != null "> and aul.create_time >= #{startTime}</if>
|
|
|
+ <if test="endTime != null "> and aul.create_time < #{endTime}</if>
|
|
|
+ order by aul.create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAlertUpvoteLogById" parameterType="Long" resultMap="AlertUpvoteLogResult">
|
|
@@ -73,10 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isDelete != null ">is_delete,</if>
|
|
|
<if test="userId != null ">user_id,</if>
|
|
|
<if test="status != null ">status,</if>
|
|
|
- <if test="loginName != null ">login_name,</if>
|
|
|
- <if test="userName != null ">user_name,</if>
|
|
|
- <if test="alertContent != null ">alert_content,</if>
|
|
|
- <if test="photoUrl != null ">photo_url,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="alertId != null ">#{alertId},</if>
|
|
@@ -87,10 +85,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isDelete != null ">#{isDelete},</if>
|
|
|
<if test="userId != null ">#{userId},</if>
|
|
|
<if test="status != null ">#{status},</if>
|
|
|
- <if test="loginName != null ">#{loginName},</if>
|
|
|
- <if test="userName != null ">#{userName},</if>
|
|
|
- <if test="alertContent != null ">#{alertContent},</if>
|
|
|
- <if test="photoUrl != null ">#{photoUrl},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -105,10 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isDelete != null ">is_delete = #{isDelete},</if>
|
|
|
<if test="userId != null ">user_id = #{userId},</if>
|
|
|
<if test="status != null ">status = #{status},</if>
|
|
|
- <if test="loginName != null ">login_name = #{loginName},</if>
|
|
|
- <if test="userName != null ">user_name = #{userName},</if>
|
|
|
- <if test="alertContent != null ">alert_content = #{alertContent},</if>
|
|
|
- <if test="photoUrl != null ">photo_url = #{photoUrl},</if>
|
|
|
</trim>
|
|
|
where alert_upvote_id = #{alertUpvoteId}
|
|
|
</update>
|