| | |
| | | string search = ""; |
| | | try |
| | | { |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and AA.operdate between @opendate and @closedate "; |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from ( |
| | | var sql = @"select top 100 percent AA.*,U.username as operusername from ( |
| | | select '点检' as opertype,chk_user as operuser,chk_date as operdate,chk_result as operresult |
| | | from TMouldchk_Proc_Main where mould_code='001' |
| | | from TMouldchk_Proc_Main where mould_code=@mouldcode |
| | | union all |
| | | select '保养' as opertype,maint_user as operuser,maint_date as operdate,maint_result as operresult |
| | | from TMouldmaint_Proc_Main where mould_code='001' |
| | | from TMouldmaint_Proc_Main where mould_code=@mouldcode |
| | | union all |
| | | select '待维修' as opertype,request_person as operuser,request_date as operdate,'维修申请' as operresult |
| | | from TMould_RepairRequest where mould_code='001' |
| | | from TMould_RepairRequest where mould_code=@mouldcode |
| | | union all |
| | | select '已维修' as opertype,repair_person as operuser,repair_date as operdate,'维修完成' as operresult |
| | | from TMould_RepairRequest A |
| | | inner join TMould_Repair B on A.docu_code=B.source_wo |
| | | where A.mould_code='001' and B.repair_person<>'' |
| | | where A.mould_code=@mouldcode and B.repair_person<>'' |
| | | union all |
| | | select '已验证' as opertype,verify_person as operuser,verify_date as operdate,B.verify_result as operresult |
| | | from TMould_RepairRequest A |
| | | inner join TMould_Repair B on A.docu_code=B.source_wo |
| | | where A.mould_code='001' and B.verify_person<>'' |
| | | where A.mould_code=@mouldcode and B.verify_person<>'' |
| | | union all |
| | | select '已上机' as opertype,lm_user as operuser,lm_date as operdate,eqp_code as operresult |
| | | from TMould_UpDownReord where mould_code='001' and type='UP' |
| | | from TMould_UpDownReord where mould_code=@mouldcode and type='UP' |
| | | union all |
| | | select '已下机' as opertype,lm_user as operuser,lm_date as operdate,eqp_code as operresult |
| | | from TMould_UpDownReord where mould_code='001' and type='DOWN' |
| | | from TMould_UpDownReord where mould_code=@mouldcode and type='DOWN' |
| | | union all |
| | | select '已入库' as opertype,lm_user as operuser,lm_date as operdate,warehouse_code as operresult |
| | | from TMould_InOutReord where mould_code='001' and type='IN' |
| | | from TMould_InOutReord where mould_code=@mouldcode and type='IN' |
| | | union all |
| | | select '已出库' as opertype,lm_user as operuser,lm_date as operdate,warehouse_code as operresult |
| | | from TMould_InOutReord where mould_code='001' and type='OUT' |
| | | from TMould_InOutReord where mould_code=@mouldcode and type='OUT' |
| | | union all |
| | | select '已外借' as opertype,lm_user as operuser,lm_date as operdate,description as operresult |
| | | from TMould_LendOutReord where mould_code='001' and type='OUT' |
| | | from TMould_LendOutReord where mould_code=@mouldcode and type='OUT' |
| | | union all |
| | | select '已归还' as opertype,lm_user as operuser,lm_date as operdate,description as operresult |
| | | from TMould_LendOutReord where mould_code='001' and type='IN' |
| | | ) as AA where 1=1 "+search+" order by AA.operdate desc "; |
| | | from TMould_LendOutReord where mould_code=@mouldcode and type='IN' |
| | | ) as AA |
| | | left join TUser U on AA.operuser=U.usercode |
| | | where 1=1 " + search+" order by AA.operdate desc "; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.message = "查询成功!"; |