| | |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from( |
| | | select A.code,A.name,A.status,A.checktype,A.sampmethod,A.sampscare,A.suitobject,A.descr,A.suitpart,A.lm_date,U.username, |
| | | select A.code,A.name,A.status,A.checktype,A.sampmethod,A.sampscare,A.suitobject,A.stepcode,S.stepname,A.descr,A.suitpart,A.lm_date,U.username, |
| | | case when A.suitobject='P' then |
| | | STUFF(( SELECT ';' + partname |
| | | FROM TMateriel_Info |
| | |
| | | FOR XML PATH('')), 1, 1,'') |
| | | end as suitpartname |
| | | from TStepCheckStandard A |
| | | left join TUser U on A.lm_user=U.usercode |
| | | left join TUser U on A.lm_user=U.usercode |
| | | left join TStep S on A.stepcode=S.stepcode |
| | | ) as AA |
| | | where " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | |
| | | #endregion |
| | | |
| | | #region[质检方案新增/编辑提交] |
| | | public static ToMessage QualityInspectionAddEditSave(string qualityinsptcode, string qualityinsptname, string status, string checktype, string sampmethod, string sampscare, string suitobject, string suitpart, string descr, string checkitem, string type, string username) |
| | | public static ToMessage QualityInspectionAddEditSave(string qualityinsptcode, string qualityinsptname, string status, string checktype, string sampmethod, string sampscare, string suitobject, string suitpart, string descr,string stepcode, string checkitem, string type, string username) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | |
| | | { |
| | | case "Add": //新增 |
| | | //写入质检方案主表 |
| | | sql = @"insert into TStepCheckStandard(code,name,status,checktype,sampmethod,sampscare,suitobject,suitpart,descr,lm_user,lm_date) |
| | | values(@code,@name,@status,@checktype,@sampmethod,@sampscare,@suitobject,@suitpart,@descr,@lm_user,@lm_date)"; |
| | | sql = @"insert into TStepCheckStandard(code,name,status,checktype,sampmethod,sampscare,suitobject,suitpart,stepcode,descr,lm_user,lm_date) |
| | | values(@code,@name,@status,@checktype,@sampmethod,@sampscare,@suitobject,@suitpart,@stepcode,@descr,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | sampscare = sampscare, |
| | | suitobject = suitobject, |
| | | suitpart = suitpart, |
| | | stepcode= stepcode, |
| | | descr = descr, |
| | | lm_user = username, |
| | | lm_date = date |
| | |
| | | list.Add(new { str = sql, parm = new { code = qualityinsptcode } }); |
| | | //修改质检方案主表 |
| | | sql = @"update TStepCheckStandard set name=@name,status=@status,checktype=@checktype,sampmethod=@sampmethod,sampscare=@sampscare, |
| | | suitobject=@suitobject,suitpart=@suitpart,descr=@descr |
| | | suitobject=@suitobject,suitpart=@suitpart,stepcode=@stepcode,descr=@descr |
| | | where code=@code"; |
| | | list.Add(new |
| | | { |
| | |
| | | sampscare = sampscare, |
| | | suitobject = suitobject, |
| | | suitpart = suitpart, |
| | | stepcode = stepcode, |
| | | descr = descr, |
| | | } |
| | | }); |