TpEEmployeeAbnormalStaTailSMapper.xml 4.25 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zteits.park.mapper.smapper.TpEEmployeeAbnormalStaTailSMapper">

  <!-- 收费员点位异常率统计,日 -->
  <select id="queryEmployeeAbnormalStatisticTotalForDay" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq"
          resultType="com.zteits.clouds.api.dto.park.dto.employee.EmployeeAbnormalStatisticTotalDTO">
      select
      ifnull(sum(e.total_points),0) as totalPoints,
      ifnull(sum(e.abnormal_times),0) as abnormalTimes,
      round(sum(e.abnormal_times) / (COUNT(e.id)*16) *100,2 ) AS employeeAbnormalRate
      from employee_abnormal_statistic_day e
      where e.data_state = 1
      and e.static_date between #{beginTime} and #{endTime}
      and e.charger_code in
      <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
        #{chargerCode}
      </foreach>
  </select>

  <!-- 收费员点位异常率统计,周 -->
  <select id="queryEmployeeAbnormalStatisticTotalForWeek" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq"
          resultType="com.zteits.clouds.api.dto.park.dto.employee.EmployeeAbnormalStatisticTotalDTO">
    select
      ifnull(sum(e.total_points),0) as totalPoints,
      ifnull(sum(e.abnormal_times),0) as abnormalTimes,
      round(sum(e.abnormal_times) / (COUNT(e.id)*16) *100,2 ) AS employeeAbnormalRate
    from employee_abnormal_statistic_week e
    where e.data_state = 1
    and e.static_date between #{beginTime} and #{endTime}
    and e.charger_code in
    <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
      #{chargerCode}
    </foreach>
  </select>

    <!-- 收费员点位异常率统计,月 -->
    <select id="queryEmployeeAbnormalStatisticTotalForMonth" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq"
            resultType="com.zteits.clouds.api.dto.park.dto.employee.EmployeeAbnormalStatisticTotalDTO">
        select
        ifnull(sum(e.total_points),0) as totalPoints,
        ifnull(sum(e.abnormal_times),0) as abnormalTimes,
        round(sum(e.abnormal_times) / (COUNT(e.id)*16) *100,2 ) AS employeeAbnormalRate
        from employee_abnormal_statistic_month e
        where e.data_state = 1
        and e.static_date between #{beginTime} and #{endTime}
        and e.charger_code in
        <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
            #{chargerCode}
        </foreach>
    </select>


    <select id="queryEmployeeAbnormalStatisticTotalForDayList" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq" resultType="java.lang.String">
        select
            DISTINCT e.charger_code
        from employee_abnormal_statistic_day e
        where e.data_state = 1
        and e.static_date between #{beginTime} and #{endTime}
        and e.charger_code in
        <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
            #{chargerCode}
        </foreach>
    </select>

    <select id="queryEmployeeAbnormalStatisticTotalForWeekList" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq" resultType="java.lang.String">
        select
        DISTINCT e.charger_code
        from employee_abnormal_statistic_week e
        where e.data_state = 1
        and e.static_date between #{beginTime} and #{endTime}
        and e.charger_code in
        <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
            #{chargerCode}
        </foreach>
    </select>


    <select id="queryEmployeeAbnormalStatisticTotalForMonthList" parameterType="com.zteits.clouds.api.dto.park.param.employee.EmployeeAbnormalStaReq" resultType="java.lang.String">
        select
        DISTINCT e.charger_code
        from employee_abnormal_statistic_month e
        where e.data_state = 1
        and e.static_date between #{beginTime} and #{endTime}
        and e.charger_code in
        <foreach collection="chargerCodes" open="(" close=")" item="chargerCode" separator=",">
            #{chargerCode}
        </foreach>
    </select>

</mapper>