MessageDao.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.inkasso.factoring.system.message.dao.MessageDAO">
  4. <update id="batchUpdateStatus" parameterType="java.lang.Long">
  5. update kfb_sys_msg set read_status = true
  6. where receive_user_id = #{userId} and read_status = false
  7. </update>
  8. <select id="findVehicleLeaderMessage" resultType="com.inkasso.factoring.system.message.entity.MessageDO">
  9. select *
  10. from kfb_sys_msg a
  11. LEFT JOIN kfb_attached_vehicle_information b on a.object_id = b.id
  12. <where>
  13. b.whether_moveOut != 1
  14. <if test="tenantId != null">
  15. and a.tenant_id = #{tenantId}
  16. </if>
  17. <if test="businessType != null">
  18. and a.business_type like CONCAT(#{businessType}, '%' )
  19. </if>
  20. <if test="beginDate != null">
  21. and DATE_FORMAT( a.create_time, '%Y-%m' ) >= DATE_FORMAT(#{beginDate}, '%Y-%m' )
  22. </if>
  23. <if test="endDate != null">
  24. and DATE_FORMAT( a.create_time, '%Y-%m' ) &lt;= DATE_FORMAT(#{endDate}, '%Y-%m' )
  25. </if>
  26. </where>
  27. </select>
  28. <!-- 分页查询 通知消息 -->
  29. <select id="pageQuery" resultType="com.inkasso.factoring.system.message.model.dto.MessageDTO">
  30. select
  31. *
  32. from kfb_sys_msg
  33. where ( receive_user_id = #{queryMessageRequest.receiveUserId} and tenant_id is null)
  34. <if test="queryMessageRequest.tenantId !=null ">
  35. or (receive_user_id = #{queryMessageRequest.receiveUserId} and tenant_id = #{queryMessageRequest.tenantId})
  36. </if>
  37. </select>
  38. </mapper>