UserwagestrategyMinidaoDao_getAllEntities.sql 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. select w.id id,
  2. w.userid userid,
  3. w.belong_unitid belong_unitid,
  4. w.dutiesid dutiesid,
  5. os.id as overtimepay_strategyid,
  6. ds.id as duty_strategyid,
  7. ts.id as traffic_subsidyid,
  8. ms.id as megathermal_subsidyid,
  9. mes.id as fixedmeals_subsidyid,
  10. mes1.id as nofixedmeals_subsidyid,
  11. ots.id as other_subsidyid,
  12. sss.id as social_security_strategyid,
  13. pfs.id as provident_fund_strategyid,
  14. w.append_pay append_pay,
  15. w.deduct_pay deduct_pay,
  16. w.daikou_fee daikou_fee,
  17. w.jiaojin_subsidyid jiaojin_subsidyid,
  18. w.project_performance project_performance,
  19. w.onlychild_pay onlychild_pay,
  20. w.strategy_type as strategy_type,
  21. u.realname,u.username,sus.userNum as userNum, dt.departname,d.id as departid,du.duties_name as dutiesname,du.id as dutid,u.id as userids from t_s_base_user u
  22. left join t_bus_user_wagestrategy w on u.id = w.userid
  23. left join t_s_user sus on u.id= sus.id
  24. LEFT JOIN t_s_user_org uo ON u.ID = uo.user_id and uo.ifpluralism = 0 and uo.status = 0
  25. left join t_s_depart d on uo.org_id = d.id
  26. left join t_s_depart dt on w.pjt_id = dt.id
  27. left join t_bus_user_personnel p on p.userid = u.id
  28. left join t_bus_duties du on du.id = p.belong_dutiesid
  29. LEFT JOIN t_bus_overtimepay_strategy os
  30. ON w.overtimepay_strategyid = os.id and os.status = '0' and os.delete_flag = '0'
  31. LEFT JOIN t_bus_dutyfee_strategy ds
  32. ON w.duty_strategyid = ds.id and ds.status = '0' and ds.delete_flag = '0'
  33. LEFT JOIN t_bus_traffic_subsidy ts
  34. ON w.traffic_subsidyid = ts.id and ts.status = '0' and ts.delete_flag = '0'
  35. LEFT JOIN t_bus_megathermal_subsidy ms
  36. ON w.megathermal_subsidyid = ms.id and ms.status = '0' and ms.delete_flag = '0'
  37. LEFT JOIN t_bus_meals_subsidy mes
  38. ON w.fixedmeals_subsidyid = mes.id and mes.status = '0' and mes.delete_flag = '0' and mes.subsidy_type = 'anyueguding'
  39. LEFT JOIN t_bus_meals_subsidy mes1
  40. ON w.nofixedmeals_subsidyid = mes1.id and mes1.status = '0' and mes1.delete_flag = '0' and mes1.subsidy_type = 'anciguding'
  41. LEFT JOIN t_bus_other_subsidy ots
  42. ON w.other_subsidyid = ots.id and ots.status = '0' and ots.delete_flag = '0'
  43. LEFT JOIN t_bus_social_security_strategy sss
  44. ON w.social_security_strategyid = sss.id and sss.status = '0' and sss.delete_flag = '0'
  45. LEFT JOIN t_bus_provident_fund_strategy pfs
  46. ON w.provident_fund_strategyid = pfs.id and pfs.status = '0' and pfs.delete_flag = '0'
  47. where 1=1
  48. and u.delete_flag != '1'
  49. <#if (userWagestrategyDao.username )?? && userWagestrategyDao.username ?length gt 0>
  50. /* 转正人编号 */
  51. and u.username like CONCAT('%', :userWagestrategyDao.username ,'%')
  52. </#if>
  53. <#if (userWagestrategyDao.realname )?? && userWagestrategyDao.realname ?length gt 0>
  54. /* 转正人名称 */
  55. and u.realname like CONCAT('%', :userWagestrategyDao.realname ,'%')
  56. </#if>
  57. <#if ( userWagestrategyDao.orgIdList )?? && userWagestrategyDao.orgIdList ?size gt 0>
  58. /* 所属单位*/
  59. and d.id in(
  60. <#list userWagestrategyDao.orgIdList as item>
  61. '${item}'
  62. <#if item_has_next>,</#if>
  63. </#list>
  64. )
  65. </#if>
  66. <#if ( useridList )?? && useridList ?size gt 0>
  67. /* 可见的用户id */
  68. and u.id in(
  69. <#list useridList as item>
  70. '${item}'
  71. <#if item_has_next>,</#if>
  72. </#list>
  73. )
  74. </#if>
  75. <#if (authSql)?? && authSql ?length gt 0>
  76. and :authSql
  77. </#if>
  78. order by w.pjt_id