| | |
| | | <select id="getPage" resultType="org.springblade.modules.messageRecord.vo.MessageUserVO"> |
| | | |
| | | SELECT |
| | | bmu.*, |
| | | bmr.title,bmr.content,bmr.create_time as sendTime,bmr.create_user as sendUserId, |
| | | bu.real_name as sendUserName, |
| | | bu1.real_name as receiveUserName |
| | | bmu.*, |
| | | bmr.title,bmr.content,bmr.create_time as sendTime,bmr.create_user as sendUserId, |
| | | bu.real_name as sendUserName, |
| | | bu1.real_name as receiveUserName |
| | | FROM blade_message_user bmu |
| | | LEFT JOIN blade_message_record bmr ON bmr.id = bmu.message_record_id |
| | | LEFT JOIN blade_user bu ON bu.id = bmr.create_user |
| | | LEFT JOIN blade_user bu1 ON bu1.id = bmu.user_id |
| | | where 1=1 |
| | | <if test="vo.userId != null and vo.userId !=''"> |
| | | and bmu.user_id = #{vo.userId} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !=''"> |
| | | AND bmu.type LIKE CONCAT('%',#{vo.type},'%') |
| | | </if> |
| | | <if test="vo.sendUserId != null and vo.sendUserId !=''"> |
| | | AND bmr.create_user = #{vo.sendUserId} |
| | | </if> |
| | | <if test="vo.userId != null and vo.userId !=''"> |
| | | and bmu.user_id = #{vo.userId} |
| | | </if> |
| | | <if test="vo.type != null and vo.type !=''"> |
| | | AND bmu.type LIKE CONCAT('%',#{vo.type},'%') |
| | | </if> |
| | | |
| | | <if test="vo.title != null and vo.title !=''"> |
| | | AND bmr.title LIKE CONCAT('%',#{vo.title},'%') |
| | | </if> |
| | | |
| | | <if test="vo.sendStatus != null and vo.sendStatus !=''"> |
| | | AND bmu.send_status = #{vo.sendStatus} |
| | | </if> |
| | | |
| | | <if test="vo.content != null and vo.content !=''"> |
| | | AND bmr.content LIKE CONCAT('%',#{vo.content},'%') |
| | | </if> |
| | | <if test="vo.sendUserId != null and vo.sendUserId !=''"> |
| | | AND bmr.create_user = #{vo.sendUserId} |
| | | </if> |
| | | <if test="vo.sendUserName != null and vo.sendUserName !=''"> |
| | | AND bu.real_name LIKE CONCAT('%',#{vo.sendUserName},'%') |
| | | </if> |
| | | <if test="vo.receiveUserName != null and vo.receiveUserName !=''"> |
| | | AND bu1.real_name LIKE CONCAT('%',#{vo.receiveUserName},'%') |
| | | </if> |
| | | ORDER BY bmu.create_time DESC |
| | | </select> |
| | | |