| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备清单查看履历] |
| | | public static ToMessage DeviceResumeSearch(string eqpcode, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and AA.operdate between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | 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 TEqpchk_Proc_Main where eqp_code=@eqpcode |
| | | union all |
| | | select '保养' as opertype,maint_user as operuser,maint_date as operdate,maint_result as operresult |
| | | from TEqpmaint_Proc_Main where eqp_code=@eqpcode |
| | | union all |
| | | select '待维修' as opertype,request_person as operuser,request_date as operdate,'维修申请' as operresult |
| | | from TEqp_RepairRequest where eqp_code=@eqpcode |
| | | union all |
| | | select '已维修' as opertype,repair_person as operuser,repair_date as operdate,'维修完成' as operresult |
| | | from TEqp_RepairRequest A |
| | | inner join TEqp_Repair B on A.docu_code=B.source_wo |
| | | where A.eqp_code=@eqpcode and B.repair_person<>'' |
| | | union all |
| | | select '已验证' as opertype,verify_person as operuser,verify_date as operdate,B.verify_result as operresult |
| | | from TEqp_RepairRequest A |
| | | inner join TEqp_Repair B on A.docu_code=B.source_wo |
| | | where A.eqp_code=@eqpcode and B.verify_person<>'' |
| | | ) 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 = "查询成功!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备点检项列表查询] |
| | | public static ToMessage DeviceCheckItemSearch(string checkitemcode, string checkitemname, string checkdescr, string isqrcode, string cycle, int startNum, int endNum, string prop, string order) |