MessageNotifyMapper.xml
1.55 KB
<?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="MessageNotifyV1ServiceDaoImpl">
<insert id="saveMessageNotify" parameterType="com.java110.po.property.MessageNotifyPo">
INSERT INTO message_notify(id, user_id, title, content, msg_type, relate_id, is_read, create_time)
VALUES(#{id}, #{userId}, #{title}, #{content}, #{msgType}, #{relateId}, 0, NOW())
</insert>
<update id="updateMessageRead" parameterType="map">
UPDATE message_notify SET is_read = 1 WHERE id = #{id}
</update>
<select id="queryMessageNotifies" parameterType="map" resultType="map">
SELECT * FROM message_notify WHERE 1=1
<if test="userId != null and userId != ''">AND user_id = #{userId}</if>
<if test="isRead != null and isRead != ''">AND is_read = #{isRead}</if>
<if test="msgType != null and msgType != ''">AND msg_type = #{msgType}</if>
ORDER BY create_time DESC
<if test="page != null and page != '' and row != null and row != ''">
LIMIT #{page}, #{row}
</if>
</select>
<select id="queryMessageNotifiesCount" parameterType="map" resultType="map">
SELECT COUNT(1) count FROM message_notify WHERE 1=1
<if test="userId != null and userId != ''">AND user_id = #{userId}</if>
<if test="isRead != null and isRead != ''">AND is_read = #{isRead}</if>
<if test="msgType != null and msgType != ''">AND msg_type = #{msgType}</if>
</select>
</mapper>