using System.Collections; using Estsh.Core.Util; using Estsh.Core.Repository.IRepositories; using Estsh.Core.Services.IServices; using Estsh.Core.Models; using Estsh.Core.Model.Result; using Estsh.Core.IRepositories; using Estsh.Core.Dapper; using Estsh.Core.Model.ExcelModel; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:质检结果查询 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class ProductDeliveryResultService : BaseService, IProductDeliveryResultService { private readonly IProductDeliveryResultRepository repository; public ProductDeliveryResultService(IProductDeliveryResultRepository _repository) : base(_repository) { repository = _repository; } /// /// 根据分页条件获取分页菜单数据 /// /// /// /// /// /// public Hashtable getInQCListByPage(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime, Pager pager, String direction, String sort) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (pdlineCode != null && !pdlineCode.Trim().Equals("")) { strWhere += "and a.pdline_code like '%" + pdlineCode.Trim() + "%'"; } if (partNo != null && !partNo.Trim().Equals("")) { strWhere += "and a.part_no like '%" + partNo.Trim() + "%'"; } if (partSpec != null && !partSpec.Trim().Equals("")) { strWhere += "and a.part_spec = '" + partSpec.Trim() + "'"; } if (serialNumber != null && !serialNumber.Trim().Equals("")) { strWhere += "and a.serial_number = '" + serialNumber.Trim() + "'"; } if (!String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime)) { strWhere += " and a.create_time BETWEEN '" + beginCreateTime.Trim() + "' AND '" + endCreateTime.Trim() + "'"; } if (String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime)) { strWhere += " and a.create_time <'" + endCreateTime.Trim() + "'"; } if (!String.IsNullOrEmpty(beginCreateTime) && String.IsNullOrEmpty(endCreateTime)) { strWhere += " and a.create_time > '" + beginCreateTime.Trim() + "'"; } String orderBy = ""; if (sort != null && !"".Equals(sort.Trim())) { orderBy += "a." + typeof(MesJisShipping).GetEntityColumnName(sort.Trim()) + " " + direction; } else { orderBy += "a." + typeof(MesJisShipping).GetEntityColumnName("createTime") + " " + direction; } result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy); return result; } public List getSearchDataList(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime) { Hashtable result = new Hashtable(); String strWhere = " 1=1 "; if (pdlineCode != null && !pdlineCode.Trim().Equals("")) { strWhere += "and pdline_code like '%" + pdlineCode.Trim() + "%'"; } if (partNo != null && !partNo.Trim().Equals("")) { strWhere += "and part_no like '%" + partNo.Trim() + "%'"; } if (partSpec != null && !partSpec.Trim().Equals("")) { strWhere += "and part_spec = '" + partSpec.Trim() + "'"; } if (serialNumber != null && !serialNumber.Trim().Equals("")) { strWhere += "and serial_number = '" + serialNumber.Trim() + "'"; } if (!String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime)) { strWhere += " and create_time BETWEEN '" + beginCreateTime.Trim() + "' AND '" + endCreateTime.Trim() + "'"; } if (String.IsNullOrEmpty(beginCreateTime) && !String.IsNullOrEmpty(endCreateTime)) { strWhere += " and create_time <'" + endCreateTime.Trim() + "'"; } if (!String.IsNullOrEmpty(beginCreateTime) && String.IsNullOrEmpty(endCreateTime)) { strWhere += " and create_time > '" + beginCreateTime.Trim() + "'"; } string orderBy = " order by create_time "; return repository.getSearchDataList(strWhere, orderBy); } } }