jiangping
2023-08-18 af00e89990ae9757cc9261cbe560873c2066b69c
server/src/main/resources/mappers/WorkorderRecordExtMapper.xml
@@ -487,6 +487,27 @@
    group by  `CREATE_USER`
   <!-- order by `CREATE_TIME` desc-->
  </select>
  <select id="getUserProduceTopData" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO"
          resultType="doumeemes.dao.business.dto.statistics.UserProduceTopModel">
    SELECT sum(a.num) as doneNum,b.user_id as userId,b.`NAME` as userName,b.PHONE
    from workorder_record a
    left join company_user b on b.DELETED=0 and b.user_id=a.CREATE_USER
    left join workorder c on a.WORKORDER_ID=c.id
    where a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} and s.status=4
    GROUP BY a.CREATE_USER
    ORDER By doneNum desc
    limit 10
  </select>
  <select id="getUnqualified7DayData" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO"
          resultType="doumeemes.dao.business.dto.statistics.Unqualified7DayModel">
    SELECT sum(a.UNQUALIFIED_NUM) as unqualifiedNum,a.CREATE_TIME
    from workorder_record a
    left join workorder c on a.WORKORDER_ID=c.id
    where  a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId}  and c.`STATUS`=4
    and 7 > (TO_DAYS(now()) - TO_DAYS(a.CREATE_TIME) )
    GROUP BY TO_DAYS(a.CREATE_TIME )
  </select>
  <select id="selectListNew" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" resultMap="WorkorderRecordExtListVO">
    SELECT
      `a`.`ID`,