| 1234567891011121314151617181920212223242526272829303132333435363738 |
- SELECT o.pjt_id pid,d.description pName,o.dept_id deptId,d1.departname pidName,o.yearmonth ,
- <#if (overtimeEntity.attType)?? && overtimeEntity.attType != 0>
- convert(sum(o.overtime_duration)/60,decimal(10,2)) overtimeDuration,
- CONCAT(floor(sum(o.overtime_duration)/60),'小时',floor(sum(o.overtime_duration) - floor(sum(o.overtime_duration)/60)*60),'分钟') overtimeDurationStr,
- sum(o.overtime_fee) overtimeFee,round(avg(o.dept_people_total)) unitPeopleTotal
- </#if>
- <#if (overtimeEntity.attType)?? && overtimeEntity.attType == 0>
- convert(o.overtime_duration/60,decimal(10,2)) overtimeDuration ,
- CONCAT(floor(o.overtime_duration/60),'小时',floor(o.overtime_duration - floor(o.overtime_duration/60)*60),'分钟') overtimeDurationStr,
- o.overtime_fee overtimeFee,o.dept_people_total unitPeopleTotal
- </#if>
- FROM t_bus_depart_overtime_statistics o
- LEFT JOIN t_s_depart d
- ON o.pjt_id = d.ID
- LEFT JOIN t_s_depart d1
- ON o.dept_id = d1.ID
- where 1=1
- <#if (overtimeEntity.attType)?? && overtimeEntity.attType == 2>
- and o.yearmonth like CONCAT('%', :overtimeEntity.attYear ,'%')
- </#if>
- <#if (overtimeEntity.attType)?? && overtimeEntity.attType != 2>
- <#if ( overtimeEntity.yearMonthList )?? && overtimeEntity.yearMonthList ?size gt 0>
- and o.yearmonth in(
- <#list overtimeEntity.yearMonthList as item>
- '${item}'
- <#if item_has_next>,</#if>
- </#list>
- )
- </#if>
- </#if>
- <#if (overtimeEntity.pid)??>
- and o.pjt_id =:overtimeEntity.pid
- </#if>
- <#if (overtimeEntity.attType)?? && overtimeEntity.attType != 0>
- GROUP BY o.dept_id
- </#if>
- order by overtimeDuration desc
|