| | |
| | | </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 |
| | | SELECT sum(a.QUALIFIED_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 company_user b on b.DELETED=0 and b.user_id=a.CREATE_USER and b.root_depart_id=a.root_depart_id |
| | | 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 c.status=4 |
| | | where to_days(a.create_time)=to_days(now()) and a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} and c.status=4 |
| | | <if test="procedureId != null"> |
| | | AND a.`PROCEDURE_ID` = #{procedureId} |
| | | </if> |
| | |
| | | <if test="procedureId != null"> |
| | | AND a.`PROCEDURE_ID` = #{procedureId} |
| | | </if> |
| | | GROUP BY TO_DAYS(d.ID ) |
| | | GROUP BY b.CATEGORY_ID |
| | | order by unqualifiedNum desc |
| | | limit 6 |
| | | </select> |
| | | <select id="getRecordLog" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" |
| | | resultType="doumeemes.dao.business.dto.statistics.RecordLogModel"> |
| | | select a.CREATE_TIME as createTime,a.UNQUALIFIED_NUM as unqualifiedNum,a.QUALIFIED_NUM as qualifiedNum, |
| | | d.name as userName,c.name as materialName,c.code as materialCode |
| | | d.name as userName,c.name as materialName,c.code as materialCode,p.name as procedureName |
| | | from workorder_record a |
| | | left join material_distribute b on a.MATERIAL_ID=b.ID |
| | | left join material c on b.MATERIAL_ID=c.ID |
| | | left join company_user d on d.DELETED=0 and d.user_id=a.CREATE_USER |
| | | left join company_user d on d.DELETED=0 and d.user_id=a.CREATE_USER and d.root_depart_id=a.root_depart_id |
| | | left join procedures p on a.PROCEDURE_ID=p.ID |
| | | left JOIN workorder e on e.id=a.WORKORDER_ID |
| | | where a.DELETED = 0 AND a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} AND e.`STATUS` = 4 |
| | | where a.DELETED = 0 AND a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} AND e.`STATUS` = 4 and a.type=1 |
| | | <if test="procedureId != null"> |
| | | AND a.`PROCEDURE_ID` = #{procedureId} |
| | | </if> |