| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="cn.gistack.sm.message.mapper.MessageRecordMapper"> |
| | | <!--namespace根据自己需要创建的的mapper的路径和名称填写--> |
| | | |
| | | <!--查询用户未读消息数量--> |
| | | <select id="getNotReadNumber" resultType="java.lang.Integer"> |
| | | select count(*) from sm_message_record where is_deleted = 0 and status = 0 and recipient = #{userId} |
| | | </select> |
| | | |
| | | <!--自定义分页列表--> |
| | | <select id="selectMessageRecordPageList" resultType="cn.gistack.sm.message.vo.MessageRecordVO"> |
| | | select * from sm_message_record where is_deleted = 0 |
| | | <if test="messageRecord.status!=null"> |
| | | and status = #{messageRecord.status} |
| | | </if> |
| | | <if test="messageRecord.recipient!=null and messageRecord.recipient!=''"> |
| | | and recipient = #{messageRecord.recipient} |
| | | </if> |
| | | <if test="messageRecord.theme!=null and messageRecord.theme!=''"> |
| | | and theme like concat('%',#{messageRecord.recipient},'%') |
| | | </if> |
| | | <if test="messageRecord.content!=null and messageRecord.content!=''"> |
| | | and content like concat('%',#{messageRecord.content},'%') |
| | | </if> |
| | | <if test="messageRecord.source!=null and messageRecord.source!=''"> |
| | | and source = #{messageRecord.source} |
| | | </if> |
| | | ORDER BY ID DESC |
| | | </select> |
| | | </mapper> |