@ -160,14 +160,31 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
. leftJoin ( "base_material as e on e.id=c.material_id" )
. leftJoin ( "system_users as f on f.id=t.owner" )
. leftJoin ( "base_procedure as g on g.id=t.procedure_id" )
. leftJoin ( "system_dept as h on h.id= f. dept_id")
. leftJoin ( "system_dept as h on h.id= d.business_ dept_id")
. groupBy ( "d.code,h.name,e.code,e.name,e.spec,t.owner,DATE_FORMAT(t.report_time,'%Y-%m-%d'),t.procedure_id" )
. eq ( TaskReportDO : : getOwner , userId )
. eq ( "DATE_FORMAT(t.report_time,'%Y%m')" , yearMonth )
. eq ( "isnull(t.dispatch_id)" , 0 )
. disableSubLogicDel ( )
;
return selectList ( query ) ;
}
default List < TaskReportDO > selectUserReportAssembleDetail ( String userId , String yearMonth ) {
MPJLambdaWrapperX < TaskReportDO > query = new MPJLambdaWrapperX < > ( ) ;
query . distinct ( )
. select ( "d.code project_code,h.name dept_name,e.code material_code,e.name material_name,e.spec,f.nickname as ownerName,DATE_FORMAT(t.report_time,'%Y-%m-%d') as report_time" )
. select ( "g.name procedure_name,sum(t.work_time) work_time,sum(t.amount) amount" )
. leftJoin ( "project_sale_order as d on d.id=SUBSTRING_INDEX(t.assemble_code,'-',1)" )
. leftJoin ( "base_material as e on e.id=t.material_id" )
. leftJoin ( "system_users as f on f.id=t.owner" )
. leftJoin ( "base_procedure as g on g.id=t.procedure_id" )
. leftJoin ( "system_dept as h on h.id=d.business_dept_id" )
. groupBy ( "d.code,h.name,e.code,e.name,e.spec,t.owner,DATE_FORMAT(t.report_time,'%Y-%m-%d'),t.procedure_id" )
. eq ( TaskReportDO : : getOwner , userId )
. eq ( "DATE_FORMAT(t.report_time,'%Y%m')" , yearMonth )
. eq ( "isnull(t.dispatch_id)" , 1 )
. disableSubLogicDel ( )
;
return selectList ( query ) ;
}