| | |
| | | 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` |
| | | LEFT JOIN `material_distribute` c ON a.MATERIAL_ID=c.ID |
| | | LEFT JOIN `material` m ON c.MATERIAL_ID=m.ID |
| | | where (a.status in (1,4) or (a.status=6 and EXISTS(select b.id from workorder_record b where b.type=1 and b.DELETED=0 and b.PLAN_ID=a.id) )) |
| | | and a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} |
| | | and a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} and a.PROCEDURE_ID=#{procedureId} |
| | | order by a.CREATE_TIME |
| | | </select> |
| | | <select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO"> |