ArrangeDutyMinidao_getArrangeDutyDtoPage.sql 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <#-- 班次设定主页显示-->
  2. select
  3. ad.id,
  4. ad.duty_name AS dutyName,
  5. ad.pid AS pid,
  6. ad.duty_type AS dutyType,
  7. ad.normalwork_stime AS normalworkStime,
  8. ad.normalwork_etime AS normalworkEtime,
  9. ad.spunch_minute AS spunchMinute,
  10. ad.epunch_minute AS epunchMinute,
  11. ad.datum_workhours AS datumWorkhours,
  12. ad.shift_workhours AS shiftWorkhours,
  13. ad.onduty_stime AS ondutyStime,
  14. ad.onduty_etime AS ondutyEtime,
  15. ad.onduty_workhours AS ondutyWorkhours,
  16. ad.timeout_overtime_stime AS timeOutOvertimeStime,
  17. ad.timeout_overtime_etime AS timeOutOvertimeEtime,
  18. ad.timeout_overtime_hours AS timeOutOvertimeHours,
  19. ad.duty_mealid AS dutyMealid,
  20. ad.remark AS remark,
  21. ad.create_name AS createName,
  22. ad.create_by AS createBy,
  23. ad.create_date AS createDate,
  24. ad.update_name AS updateName,
  25. ad.update_by AS updateBy,
  26. ad.update_date AS updateDate,
  27. ad.sys_org_code AS sysOrgCode,
  28. ad.sys_company_code AS sysCompanyCode,
  29. ad.status AS status,
  30. ad.delete_flag AS deleteFlag
  31. from t_bus_arrange_duty ad where 1 = 1
  32. <#if ( arrangeDutyDto.pidList )?? && arrangeDutyDto.pidList ?size gt 0>
  33. and ad.pid in(
  34. <#list arrangeDutyDto.pidList as item>
  35. '${item}'
  36. <#if item_has_next>,</#if>
  37. </#list>
  38. )
  39. <#else >
  40. and ad.id=null
  41. </#if>
  42. <#if (arrangeDutyDto.dutyName )?? && arrangeDutyDto.dutyName ?length gt 0>
  43. /* 班次名称 */
  44. and ad.duty_name like CONCAT('%', :arrangeDutyDto.dutyName ,'%')
  45. </#if>
  46. <#if ( arrangeDutyDto.dutyType )?? && arrangeDutyDto.dutyType ?length gt 0>
  47. /* 班次类型*/
  48. and ad.duty_type = :arrangeDutyDto.dutyType
  49. </#if>
  50. <#if ( arrangeDutyDto.status )?? && arrangeDutyDto.status ?length gt 0>
  51. /* 班次类型*/
  52. and ad.status = :arrangeDutyDto.status
  53. </#if>
  54. and ad.delete_flag = 0
  55. ORDER BY
  56. ad.create_date DESC