NotifyDetailDao.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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="platform.modules.government.dao.NotifyDetailDao">
  4. <select id="findNotifyByDetailId" resultType="platform.modules.government.entity.Notify">
  5. select * from z_notify n
  6. left join z_notify_detail d on n.id = d.z_notify_id
  7. where d.id = #{notify_detail_id}
  8. </select>
  9. <select id="findByPushIdAndNotifyId" resultType="platform.modules.government.entity.NotifyDetail">
  10. select * from z_notify_detail n
  11. where n.z_notify_id = #{detail.z_notify_id}
  12. and n.push_id = #{detail.push_id} and n.user_type = #{detail.user_type}
  13. and n.push_type = #{detail.push_type}
  14. <if test="detail.push_street_id!=null and detail.push_street_id!=''">
  15. and n.push_street_id=#{detail.push_street_id}
  16. </if>
  17. <if test="detail.push_build_id!=null and detail.push_build_id!='' ">
  18. and n.push_build_id=#{detail.push_build_id}
  19. </if>
  20. </select>
  21. <select id="findPushedIdsByNotifyId" resultType="java.util.HashMap">
  22. select group_concat(push_id)
  23. from z_notify_detail n
  24. where n.z_notify_id = #{detail.z_notify_id}
  25. and n.user_type = #{detail.user_type}
  26. <if test="detail.push_street_id!=null and detail.push_street_id!=''">
  27. and n.push_street_id=#{detail.push_street_id}
  28. </if>
  29. <if test="detail.push_build_id!=null and detail.push_build_id!='' ">
  30. and n.push_build_id=#{detail.push_build_id}
  31. </if>
  32. group by push_type
  33. </select>
  34. <select id="getPushDate" resultType="java.lang.String">
  35. select n.create_time from z_notify_detail n
  36. where n.z_notify_id = #{detail.z_notify_id}
  37. and n.user_type = #{detail.user_type}
  38. <if test="detail.push_street_id!=null and detail.push_street_id!=''">
  39. and n.push_street_id=#{detail.push_street_id}
  40. </if>
  41. <if test="detail.push_build_id!=null and detail.push_build_id!='' ">
  42. and n.push_build_id=#{detail.push_build_id}
  43. </if>
  44. order by create_time asc
  45. limit 1
  46. </select>
  47. </mapper>