UserWageMinidaoDao_getMoneySUM.sql 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. SELECT SUM(basic_wage) basic_wage,SUM(duties_allowance) duties_allowance,SUM(certificate_subsidy) certificate_subsidy,
  2. SUM(traffic_subsidy) traffic_subsidy,SUM(megathermal_subsidy) megathermal_subsidy,SUM(only_child_cost) only_child_cost,SUM(other_subsidy) other_subsidy
  3. ,SUM(bonus) bonus,SUM(project_performance) project_performance,SUM(meals_subsidy_day) meals_subsidy_day,SUM(meals_subsidy_night)meals_subsidy_night,
  4. SUM(meals_subsidy) meals_subsidy,SUM(overtimepay_timeout) overtimepay_timeout,SUM(overtimepay_fixed) overtimepay_fixed,
  5. SUM(duty) duty,SUM(special_overtime) special_overtime,SUM(sick_leave_debit) sick_leave_debit,SUM(thing_leave_debit) thing_leave_debit,
  6. SUM(absence_debit) absence_debit,SUM(payment_subsidy) payment_subsidy,
  7. SUM(social_security_debit) social_security_debit,SUM(provident_fund_debit) provident_fund_debit,SUM(com_social_security_debit) com_social_security_debit,
  8. SUM(com_provident_fund_debit) com_provident_fund_debit,SUM(pre_tax_mone) pre_tax_mone,SUM(comcost) comCost,
  9. SUM(daikou_debit) daikouDebit,SUM(other_debit) other_debit,sum(reissue) reissue,SUM(tax_money) tax_money,SUM(actual_money) actual_money FROM t_bus_user_wage c
  10. left join t_s_base_user u on c.userid = u.id
  11. left join t_bus_user_personnel per on per.userid = u.id and per.position_status != 0
  12. left join t_bus_duties du on du.id = per.belong_dutiesid
  13. left join t_bus_duties pdu on pdu.id = du.parent_dutiesid
  14. where 1=1 and u.delete_flag='0'
  15. <#if (userWageDto.username )?? && userWageDto.username ?length gt 0>
  16. /* 转正人编号 */
  17. and u.username like CONCAT('%', :userWageDto.username ,'%')
  18. </#if>
  19. <#if (userWageDto.realname )?? && userWageDto.realname ?length gt 0>
  20. /* 转正人名称 */
  21. and u.realname like CONCAT('%', :userWageDto.realname ,'%')
  22. </#if>
  23. <#if ( userWageDto.bpmStatus )?? && userWageDto.bpmStatus ?length gt 0>
  24. /* 申请状态*/
  25. and c.bpm_status = :userWageDto.bpmStatus
  26. </#if>
  27. <#if ( userWageDto.orgIdList )?? && userWageDto.orgIdList ?size gt 0>
  28. /* 所属单位*/
  29. and c.pjt_id in(
  30. <#list userWageDto.orgIdList as item>
  31. '${item}'
  32. <#if item_has_next>,</#if>
  33. </#list>
  34. )
  35. </#if>
  36. <#if ( userWageDto.monthly )?? && userWageDto.monthly ?length gt 0>
  37. /* 申请状态*/
  38. and c.monthly = :userWageDto.monthly
  39. </#if>
  40. <#if ( uidList )?? && uidList ?size gt 0>
  41. /* 可见的用户id */
  42. and u.id in(
  43. <#list uidList as item>
  44. '${item}'
  45. <#if item_has_next>,</#if>
  46. </#list>
  47. )
  48. </#if>
  49. <#if ( moth )?? && moth ?length gt 0>
  50. /* 申请状态*/
  51. and (per.leave_date > :moth or per.leave_date is null)
  52. </#if>