AttendanceWarnMsgMinidao_getAttendanceWarnMsgDtoPage.sql 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <#-- 考勤预警消息表--首页数据全部展示--分页-->
  2. select
  3. awm.id,
  4. awm.msg_type as msgType,
  5. awm.msg_title as msgTitle,
  6. awm.msg_content as msgContent,
  7. awm.send_status as sendStatus,
  8. awm.org_id as orgId,
  9. awm.create_date as createDate,
  10. awm.send_time as sendTime,
  11. awm.user_id as userId
  12. from t_bus_attendance_warn_msg awm
  13. left join t_bus_attendance_warn_msg_detail awmd on awm.id=awmd.msg_id
  14. where 1 = 1
  15. <#if (attendanceWarnMsgDto.receivedId )?? && attendanceWarnMsgDto.receivedId ?length gt 0>
  16. AND awmd.received_id like CONCAT('%', :attendanceWarnMsgDto.receivedId ,'%')
  17. <#else>
  18. AND awmd.received_id = null
  19. </#if>
  20. <#if (attendanceWarnMsgDto.msgType )?? && attendanceWarnMsgDto.msgType ?length gt 0>
  21. <#if attendanceWarnMsgDto.msgType == 'chidaozaotui'>
  22. and (awm.msg_type like '%chidao%' or awm.msg_type like '%zaotui%')
  23. <#else>
  24. and awm.msg_type like CONCAT('%', :attendanceWarnMsgDto.msgType ,'%')
  25. </#if>
  26. </#if>
  27. <#if (attendanceWarnMsgDto.createDate_begin1 )?? >
  28. and awm.create_date >= :attendanceWarnMsgDto.createDate_begin1
  29. </#if>
  30. <#if (attendanceWarnMsgDto.createDate_end2 )?? >
  31. and awm.create_date <= :attendanceWarnMsgDto.createDate_end2
  32. </#if>
  33. ORDER BY
  34. awm.create_date desc