public ListEntity <ListAttendanceLogEntity> GetList(string userId, string year, string month, int pageIndex, int pageSize)
        {
            var list = this.context.AttendanceLog.Where(c => true);

            if (!string.IsNullOrWhiteSpace(userId))
            {
                list = list.Where(c => c.UserId == userId);
            }

            if (!string.IsNullOrWhiteSpace(year))
            {
                list = list.Where(c => c.AttendanceYear == year);
            }

            if (!string.IsNullOrWhiteSpace(month))
            {
                list = list.Where(c => c.AttendanceMonth == month);
            }
            List <ListAttendanceLogEntity> tempList = new List <ListAttendanceLogEntity>();
            int total = list.Count();

            if (total <= 0)
            {
                return(new ListEntity <ListAttendanceLogEntity>(tempList, total, pageIndex, pageSize));
            }

            List <string> ids = list.OrderByDescending(c => c.AttendanceTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(c => c.Id).ToList();

            BaseQuery query = new BaseQuery("SELECT Id,AttendanceIp,AttendanceTime,AttendanceType,AttendanceYear,LogoutTime,LogoutType,AttendanceMonth, (select name from UserInfo where Id=UserId) as UserName FROM AttendanceLog where id in @ids", new { ids = ids });

            tempList = DapperContext.BaseGetListByParam <ListAttendanceLogEntity>(query);
            return(new ListEntity <ListAttendanceLogEntity>(tempList, total, pageIndex, pageSize));
        }
Exemple #2
0
        public ListEntity <ListResignEntity> GetList(string key, int pageIndex, int pageSize)
        {
            List <ListResignEntity> list = new List <ListResignEntity>();
            int total = this.context.Resign.Where(c => c.Name.Contains(key)).Count();

            if (total <= 0)
            {
                return(new ListEntity <ListResignEntity>(list, total, pageIndex, pageSize));
            }
            List <string> ids   = this.context.Resign.Where(c => c.Name.Contains(key)).OrderBy(c => c.CreateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(c => c.Id).ToList();
            BaseQuery     query = new BaseQuery("SELECT Id,Name,Description,CreateTime,Responsibility FROM Resign as de where id in @ids", new { ids = ids });

            list = DapperContext.BaseGetListByParam <ListResignEntity>(query);
            return(new ListEntity <ListResignEntity>(list, total, pageIndex, pageSize));
        }
Exemple #3
0
        public ListEntity<ListDimissionRecordEntity> GetListByUserId(string id, int pageIndex, int pageSize)
        {
            List<ListDimissionRecordEntity> list = new List<ListDimissionRecordEntity>();
            var templist = this.context.DimissionRecord.Where(c => true);
            if (!string.IsNullOrWhiteSpace(id))
            {
                templist = templist.Where(c => c.UserId == id);
            }

            int total = templist.Count();
            if (total <= 0)
            {
                return new ListEntity<ListDimissionRecordEntity>(list, total, pageIndex, pageSize);
            }
            List<string> ids = templist.OrderBy(c => c.CreateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(c => c.Id).ToList();

            BaseQuery query = new BaseQuery("SELECT Id,DimissionTime,ApplyTime,Type,Content, CreateTime,(SELECT Name from Department where Id=DepartmentId) as DepartmentName, (SELECT Name from UserInfo where Id=UserId) as UserName FROM DimissionRecord where Id in @ids", new { ids = ids });
            list = DapperContext.BaseGetListByParam<ListDimissionRecordEntity>(query);
            return new ListEntity<ListDimissionRecordEntity>(list, total, pageIndex, pageSize);
        }
        public ListEntity <ListUserEntity> GetListByKey(string key, int pageIndex, int pageSize)
        {
            int total = this.context.UserInfo.Where(c => c.Name.Contains(key) && c.Status != -1).Count();
            List <ListUserEntity> list = new List <ListUserEntity>();

            if (total <= 0)
            {
                return(new ListEntity <ListUserEntity>(list, 0, pageIndex, pageSize));
            }
            List <string> ids   = this.context.UserInfo.Where(c => c.Name.Contains(key) && c.Status != -1).OrderBy(c => c.Id).Skip((pageIndex - 1) * pageSize).Select(c => c.Id).ToList();
            BaseQuery     query = new BaseQuery("SELECT us.id,us.Status ,de.Name as DepartmentName,us.CreateTime,res.Name as ResignName,us.Name FROM UserInfo as us LEFT JOIN Department as de on us.DepartmentId=de.Id LEFT JOIN Resign as res on us.Resign=res.Id where us.id in @ids", new { ids = ids });

            // BaseQuery query = new BaseQuery("select id from UserInfo where id in @ids", new { ids =ids });
            list = DapperContext.BaseGetListByParam <ListUserEntity>(query);
            foreach (var item in list)
            {
                if (item.Status == "0")
                {
                    item.Status = "试用期";
                }

                if (item.Status == "1")
                {
                    item.Status = "转正";
                }

                if (item.Status == "2")
                {
                    item.Status = "离职";
                }

                if (item.Status == "3")
                {
                    item.Status = "辞退";
                }
            }
            return(new ListEntity <ListUserEntity>(list, total, pageIndex, pageSize));
        }
        public ListEntity <ListUserModifyLogEntity> GetList(string id, int pageIndex, int pageSize)
        {
            List <ListUserModifyLogEntity> list = new List <ListUserModifyLogEntity>();
            var templist = this.context.UserModifyLog.Where(c => true);

            if (!string.IsNullOrWhiteSpace(id))
            {
                templist = templist.Where(c => c.ModifyUserId == id);
            }

            int total = templist.Count();

            if (total <= 0)
            {
                return(new ListEntity <ListUserModifyLogEntity>(list, total, pageIndex, pageSize));
            }
            List <string> ids = templist.OrderBy(c => c.ModifyTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(c => c.Id).ToList();

            BaseQuery query = new BaseQuery("SELECT Id,ModifyTime,ModifyUserId,CreateUserId,NowDepartmentId,NowResign,OrginalDepartmentId,OriginalResign,Content,(SELECT Name from UserInfo where Id=ModifyUserId) as UserName,(SELECT Name from Resign where id=OriginalResign) as OriginalResignName,(SELECT Name from Resign where id=NowResign) as NowResignName, (SELECT Name from Department where id=OrginalDepartmentId) as OrginalDepartmentName,(SELECT Name from Department where id=NowDepartmentId) as NowDepartmentName  FROM UserModifyLog where id in @ids", new { ids = ids });

            list = DapperContext.BaseGetListByParam <ListUserModifyLogEntity>(query);
            return(new ListEntity <ListUserModifyLogEntity>(list, total, pageIndex, pageSize));
        }
Exemple #6
0
        public ListEntity <ListSalaryModifyLogEntity> GetList(string id, int pageIndex, int pageSize)
        {
            List <ListSalaryModifyLogEntity> list = new List <ListSalaryModifyLogEntity>();
            var templist = this.context.SalaryModifyLog.Where(c => true);

            if (!string.IsNullOrWhiteSpace(id))
            {
                templist = templist.Where(c => c.UserId == id);
            }

            int total = templist.Count();

            if (total <= 0)
            {
                return(new ListEntity <ListSalaryModifyLogEntity>(list, total, pageIndex, pageSize));
            }
            List <string> ids = templist.OrderBy(c => c.CreateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(c => c.Id).ToList();

            BaseQuery query = new BaseQuery("SELECT Id, UserId,CreateTime,CreateUserId,SalaryModify,OriginalSalary,Content,(SELECT Name from UserInfo where Id=UserId) as UserName FROM SalaryModifyLog where Id in @ids", new { ids = ids });

            list = DapperContext.BaseGetListByParam <ListSalaryModifyLogEntity>(query);
            return(new ListEntity <ListSalaryModifyLogEntity>(list, total, pageIndex, pageSize));
        }