Mr.Zhang
2023-08-22 e2ed556bb9331cb65daf184eed646a7295c37b51
server/src/main/resources/mappers/PlansExtMapper.xml
@@ -298,12 +298,12 @@
    left join procedures b on a.PROCEDURE_ID =b.ID
    where ( a.`STATUS` in (1,4) or a.`STATUS`=6 and EXISTS(select e.id from workorder_record e where e.PLAN_ID = a.id and TO_DAYS(now())=TO_DAYS(e.CREATE_TIME)))
    and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId}
    and b.DELETED=0 and a.ROOT_DEPART_ID=132
    and b.DELETED=0
    GROUP BY a.PROCEDURE_ID
    order by b.SORTNUM
  </select>
  <select id="selectStatisticsList" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultType="doumeemes.dao.business.dto.statistics.ProcedurePlansPageModel">
    select a.status,a.NUM,m.name as categoryName,m.code as materialCode
    select a.status,a.NUM,m.name as categoryName,m.code as materialCode,m.name as materialName
    ,(select sum(b.UNQUALIFIED_NUM) from workorder_record b where b.type=1 and b.DELETED=0 and b.PLAN_ID=a.id) as unqualifiedNum
    ,(select sum(b.QUALIFIED_NUM) from workorder_record b where b.type=1 and b.DELETED=0 and b.PLAN_ID=a.id) as qualifiedNum
    FROM `plans` `a`