using HH.WMS.Common; using HH.WMS.Entitys; using HH.WMS.Entitys.Basic; using HH.WMS.Entitys.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HH.WMS.DAL.Pda { public class GlDAL : DapperBaseDAL { #region 根据库区取占用的货位 /// /// 根据库区取占用的货位 /// /// /// public List GetUsedLocationByArea(string areaCode) { string sql = @"SELECT * FROM TN_WM_B_LOCATION_EXT WHERE CN_S_AREA_CODE=@CN_S_AREA_CODE AND (CN_S_LOCATION_STATE!='正常' OR CN_S_USE_STATE='满')"; return ExecuteQuery(sql, new { CN_S_AREA_CODE = areaCode }); } #endregion #region 服务执行记录日志分页 /// /// 服务执行记录日志分页 /// /// /// public OperateResult GetServiceExecList(SearchModel sm) { string taskType = Util.ToStringInput(sm.SearchCondition.taskType); string taskNo = Util.ToStringInput(sm.SearchCondition.taskNo); string isComplete = Util.ToStringInput(sm.SearchCondition.isComplete); string isSendMes = Util.ToStringInput(sm.SearchCondition.isSendMes); string strWhere = " WHERE 1=1 "; if (!string.IsNullOrEmpty(taskType)) { strWhere += " AND CN_S_TASK_TYPE='" + taskType + "'"; } if (!string.IsNullOrEmpty(taskNo)) { strWhere += " AND CN_S_TASK_NO LIKE '%" + taskNo + "%'"; } if (!string.IsNullOrEmpty(isComplete)) { strWhere += " AND CN_C_COMPLETE='" + isComplete + "'"; } if (!string.IsNullOrEmpty(isSendMes)) { strWhere += " AND CN_C_SEND_MES='" + isSendMes + "'"; } string orderBy = " ORDER BY CN_T_CREATE DESC"; string sql = @"(SELECT * FROM TN_WM_SERVICE_EXEC " + strWhere + ") as t "; long total; var dt = ExecutePagingData(sql, sm.PageIndex, sm.PageSize, out total, orderBy, ""); return OperateResult.Succeed("", new { total = total, rows = dt }); } #endregion } }