| | |
| | | <select id="salaryStatistic" parameterType="doumeemes.dao.ext.dto.QuerySalaryStatisticDTO" resultType="doumeemes.dao.ext.vo.SalaryStatisticsListVO"> |
| | | select `CREATE_USER` as userId ,sum(CASE WHEN salary_type=0 THEN salary ELSE 0 END ) as jijianSalary |
| | | ,sum(CASE WHEN salary_type=0 THEN 0 ELSE salary END ) as jishiSalary |
| | | ,count(distinct(a.workorder_id)) as num |
| | | ,count(distinct(workorder_id)) as num |
| | | ,sum(salary) as totalSalary |
| | | from `workorder_record` |
| | | where `DELETED` =0 and `SALARY` >0 |
| | |
| | | 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 |
| | | 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> |
| | |
| | | </select> |
| | | <select id="selectListNew" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" resultMap="WorkorderRecordExtListVO"> |
| | | SELECT |
| | | `a`.`ID`, |
| | | `a`.`DELETED`, |
| | | `a`.`CREATE_USER`, |
| | | `a`.`CREATE_TIME`, |
| | | `a`.`UPDATE_USER`, |
| | | `a`.`UPDATE_TIME`, |
| | | `a`.`REMARK`, |
| | | `a`.`ROOT_DEPART_ID`, |
| | | `a`.`DEPART_ID`, |
| | | `a`.`PLAN_ID`, |
| | | `a`.`WORKORDER_ID`, |
| | | `a`.`BATCH`, |
| | | `a`.`FACTORY_ID`, |
| | | `a`.`PROCEDURE_ID`, |
| | | `a`.`PRO_DEVICE_ID`, |
| | | `a`.`APPLIANCES_ID`, |
| | | `a`.`PRO_DATE`, |
| | | `a`.`TYPE`, |
| | | `a`.`NUM`, |
| | | `a`.`DONE_TYPE`, |
| | | `a`.`MATERIAL_ID`, |
| | | `a`.`UNIT_ID`, |
| | | `a`.`MATERIAL_BATCH`, |
| | | `a`.`CHECK_WAY`, |
| | | `a`.`CHECK_USER_ID`, |
| | | `a`.`QUALIFIED_NUM`, |
| | | `a`.`UNQUALIFIED_NUM`, |
| | | `a`.`CHECK_DATE`, |
| | | `a`.`CHECK_INFO`, |
| | | `a`.`QUALIFIED_APPLIANCE_ID`, |
| | | `a`.`PRO_USERIDS`, |
| | | `a`.MATERIAL_DONETYPE,`a`.MATERIAL_PROCEDURE_ID,`a`.RELOBJ_ID,`a`.RELOBJ_TYPE, |
| | | `a`.*, |
| | | `dmodel`.`ID` AS DMODEL_ID, |
| | | `dmodel`.`DELETED` AS DMODEL_DELETED, |
| | | `dmodel`.`CREATE_USER` AS DMODEL_CREATE_USER, |