From 6c3efee19ad1f9741ce613496ba64c4a0aa40442 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Fri, 14 Oct 2022 22:10:36 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=93?=
=?UTF-8?q?=E5=82=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Repository/System/CommonLangRepository.cs | 20 ---
ZR.Repository/System/GenTableRepository.cs | 91 -------------
ZR.Repository/System/SysConfigRepository.cs | 19 ---
ZR.Repository/System/SysDeptRepository.cs | 23 ----
ZR.Repository/System/SysDictDataRepository.cs | 124 ------------------
ZR.Repository/System/SysDictRepository.cs | 56 --------
.../System/SysLogininfoRepository.cs | 89 -------------
ZR.Repository/System/SysOperLogRepository.cs | 72 ----------
ZR.Repository/System/SysPostRepository.cs | 15 ---
ZR.Repository/System/SysTasksQzRepository.cs | 15 ---
ZR.Repository/System/SysUserPostRepository.cs | 27 ----
ZR.Repository/ZR.Repository.csproj | 15 ---
12 files changed, 566 deletions(-)
delete mode 100644 ZR.Repository/System/CommonLangRepository.cs
delete mode 100644 ZR.Repository/System/GenTableRepository.cs
delete mode 100644 ZR.Repository/System/SysConfigRepository.cs
delete mode 100644 ZR.Repository/System/SysDeptRepository.cs
delete mode 100644 ZR.Repository/System/SysDictDataRepository.cs
delete mode 100644 ZR.Repository/System/SysDictRepository.cs
delete mode 100644 ZR.Repository/System/SysLogininfoRepository.cs
delete mode 100644 ZR.Repository/System/SysOperLogRepository.cs
delete mode 100644 ZR.Repository/System/SysPostRepository.cs
delete mode 100644 ZR.Repository/System/SysTasksQzRepository.cs
delete mode 100644 ZR.Repository/System/SysUserPostRepository.cs
diff --git a/ZR.Repository/System/CommonLangRepository.cs b/ZR.Repository/System/CommonLangRepository.cs
deleted file mode 100644
index 9ef5eb1..0000000
--- a/ZR.Repository/System/CommonLangRepository.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using Infrastructure.Attribute;
-using ZR.Repository.System;
-using ZR.Model.Models;
-
-namespace ZR.Repository
-{
- ///
- /// 多语言配置仓储
- ///
- /// @author zr
- /// @date 2022-05-06
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class CommonLangRepository : BaseRepository
- {
- #region 业务逻辑代码
- #endregion
- }
-}
\ No newline at end of file
diff --git a/ZR.Repository/System/GenTableRepository.cs b/ZR.Repository/System/GenTableRepository.cs
deleted file mode 100644
index 018d3d6..0000000
--- a/ZR.Repository/System/GenTableRepository.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using Infrastructure.Attribute;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using ZR.Model.System.Generate;
-
-namespace ZR.Repository.System
-{
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class GenTableRepository : BaseRepository
- {
-
- }
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class GenTableColumnRepository : BaseRepository
- {
- ///
- /// 根据表id批量删除表字段
- ///
- ///
- ///
- public int DeleteGenTableColumn(long[] tableId)
- {
- return Context.Deleteable().Where(f => tableId.Contains(f.TableId)).ExecuteCommand();
- }
-
- ///
- /// 根据表名删除字段
- ///
- ///
- ///
- public int DeleteGenTableColumnByTableName(string tableName)
- {
- return Context.Deleteable().Where(f => f.TableName == tableName).ExecuteCommand();
- }
-
- ///
- /// 获取表所有字段
- ///
- ///
- ///
- public List GenTableColumns(long tableId)
- {
- return Context.Queryable().Where(f => f.TableId == tableId).OrderBy(x => x.Sort).ToList();
- }
-
- ///
- /// 插入表字段
- ///
- ///
- ///
- public int InsertGenTableColumn(List tableColumn)
- {
- return Context.Insertable(tableColumn).IgnoreColumns(x => new { x.Remark }).ExecuteCommand();
- }
-
- ///
- /// 批量更新表字段
- ///
- ///
- ///
- public int UpdateGenTableColumn(List tableColumn)
- {
- return Context.Updateable(tableColumn)
- .WhereColumns(it => new { it.ColumnId, it.TableId})
- .UpdateColumns(it => new
- {
- it.ColumnComment,
- it.CsharpField,
- it.CsharpType,
- it.IsQuery,
- it.IsEdit,
- it.IsInsert,
- it.IsList,
- it.QueryType,
- it.HtmlType,
- it.IsRequired,
- it.Sort,
- it.Update_time,
- it.DictType,
- it.Update_by,
- it.Remark,
- it.IsSort
- })
- .ExecuteCommand();
- }
- }
-}
diff --git a/ZR.Repository/System/SysConfigRepository.cs b/ZR.Repository/System/SysConfigRepository.cs
deleted file mode 100644
index 63ae19b..0000000
--- a/ZR.Repository/System/SysConfigRepository.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using Infrastructure.Attribute;
-using ZR.Model.System;
-
-namespace ZR.Repository
-{
- ///
- /// 参数配置仓储接口的实现
- ///
- /// @author zhaorui
- /// @date 2021-09-29
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysConfigRepository : BaseRepository
- {
- #region 业务逻辑代码
- #endregion
- }
-}
\ No newline at end of file
diff --git a/ZR.Repository/System/SysDeptRepository.cs b/ZR.Repository/System/SysDeptRepository.cs
deleted file mode 100644
index d9adac0..0000000
--- a/ZR.Repository/System/SysDeptRepository.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Infrastructure.Attribute;
-using System.Collections.Generic;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- ///
- /// 角色部门
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysRoleDeptRepository : BaseRepository
- {
- ///
- /// 根据角色获取菜单id
- ///
- ///
- ///
- public List SelectRoleDeptByRoleId(long roleId)
- {
- return Context.Queryable().Where(it => it.RoleId == roleId).ToList();
- }
- }
-}
diff --git a/ZR.Repository/System/SysDictDataRepository.cs b/ZR.Repository/System/SysDictDataRepository.cs
deleted file mode 100644
index c15ca6a..0000000
--- a/ZR.Repository/System/SysDictDataRepository.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using Infrastructure.Attribute;
-using Infrastructure.Model;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using ZR.Model;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- ///
- /// 字典数据
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysDictDataRepository : BaseRepository
- {
- ///
- /// 字典类型数据搜索
- ///
- ///
- ///
- ///
- public PagedInfo SelectDictDataList(SysDictData dictData, PagerInfo pagerInfo)
- {
- var exp = Expressionable.Create();
- exp.AndIF(!string.IsNullOrEmpty(dictData.DictLabel), it => it.DictLabel.Contains(dictData.DictLabel));
- exp.AndIF(!string.IsNullOrEmpty(dictData.Status), it => it.Status == dictData.Status);
- exp.AndIF(!string.IsNullOrEmpty(dictData.DictType), it => it.DictType == dictData.DictType);
- return GetPages(exp.ToExpression(), pagerInfo);
- }
-
- ///
- /// 根据字典类型查询
- ///
- ///
- ///
- public List SelectDictDataByType(string dictType)
- {
- return Context.Queryable().Where(f => f.Status == "0" && f.DictType == dictType)
- .OrderBy(it => it.DictSort)
- .ToList();
- }
-
- ///
- /// 根据字典类型查询
- ///
- ///
- ///
- public List SelectDictDataByTypes(string[] dictTypes)
- {
- return Context.Queryable().Where(f => f.Status == "0" && dictTypes.Contains(f.DictType))
- .OrderBy(it => it.DictSort)
- .ToList();
- }
- ///
- /// 新增保存字典数据信息
- ///
- ///
- ///
- public long InsertDictData(SysDictData dict)
- {
- var result = Context.Insertable(dict).ExecuteReturnBigIdentity();
- return result;
- }
-
- ///
- /// 修改数据
- ///
- ///
- ///
- public long UpdateDictData(SysDictData dict)
- {
- return Context.Updateable()
- .SetColumns(t => new SysDictData()
- {
- Remark = dict.Remark,
- Update_time = DateTime.Now,
- DictSort = dict.DictSort,
- DictLabel = dict.DictLabel,
- DictValue = dict.DictValue,
- Status = dict.Status,
- CssClass = dict.CssClass,
- ListClass = dict.ListClass
- })
- .Where(f => f.DictCode == dict.DictCode).ExecuteCommand();
- }
-
- ///
- /// 批量删除字典数据信息
- ///
- ///
- ///
- public int DeleteDictDataByIds(long[] dictCodes)
- {
- return Delete(dictCodes);
- }
-
- ///
- /// 同步修改字典类型
- ///
- /// 旧字典类型
- /// 新字典类型
- ///
- public int UpdateDictDataType(string old_dictType, string new_dictType)
- {
- //只更新DictType字段根据where条件
- return Context.Updateable()
- .SetColumns(t => new SysDictData() { DictType = new_dictType })
- .Where(f => f.DictType == old_dictType)
- .ExecuteCommand();
- }
-
- ///
- /// 根据字典类型查询自定义sql
- ///
- ///
- ///
- public List SelectDictDataByCustomSql(SysDictType sysDictType)
- {
- return Context.Ado.SqlQuery(sysDictType?.CustomSql).ToList();
- }
- }
-}
diff --git a/ZR.Repository/System/SysDictRepository.cs b/ZR.Repository/System/SysDictRepository.cs
deleted file mode 100644
index a315c7c..0000000
--- a/ZR.Repository/System/SysDictRepository.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using Infrastructure.Attribute;
-using SqlSugar;
-using System.Collections.Generic;
-using ZR.Model;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- ///
- /// 字典
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysDictRepository : BaseRepository
- {
- public List GetAll()
- {
- return Context.Queryable().ToList();
- }
-
- ///
- /// 查询字段类型列表
- ///
- /// 实体模型
- ///
- public PagedInfo SelectDictTypeList(SysDictType dictType, PagerInfo pager)
- {
- var exp = Expressionable.Create();
- exp.AndIF(!string.IsNullOrEmpty(dictType.DictName), it => it.DictName.Contains(dictType.DictName));
- exp.AndIF(!string.IsNullOrEmpty(dictType.Status), it => it.Status == dictType.Status);
- exp.AndIF(!string.IsNullOrEmpty(dictType.DictType), it => it.DictType.Contains(dictType.DictType));
- exp.AndIF(!string.IsNullOrEmpty(dictType.Type), it => it.Type.Equals(dictType.Type));
-
- return GetPages(exp.ToExpression(), pager, f => f.DictId, OrderByType.Desc);
- }
-
- ///
- /// 批量删除
- ///
- ///
- ///
- public int DeleteDictTypeByIds(long[] id)
- {
- return Context.Deleteable().In(id).ExecuteCommand();
- }
-
- ///
- /// 修改
- ///
- ///
- ///
- public int UpdateDictType(SysDictType dictType)
- {
- return Context.Updateable(dictType).IgnoreColumns(it => new { dictType.Create_by }).ExecuteCommand();
- }
- }
-}
diff --git a/ZR.Repository/System/SysLogininfoRepository.cs b/ZR.Repository/System/SysLogininfoRepository.cs
deleted file mode 100644
index 5ab19fd..0000000
--- a/ZR.Repository/System/SysLogininfoRepository.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using Infrastructure.Attribute;
-using Infrastructure.Extensions;
-using System.Collections.Generic;
-using ZR.Model;
-using ZR.Model.System.Dto;
-using ZR.Model.System;
-using SqlSugar;
-
-namespace ZR.Repository.System
-{
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysLogininfoRepository : BaseRepository
- {
- ///
- /// 查询登录日志
- ///
- ///
- ///
- ///
- public PagedInfo GetLoginLog(SysLogininfor logininfoDto, PagerInfo pager)
- {
- var exp = Expressionable.Create();
- exp.And(it => it.LoginTime >= logininfoDto.BeginTime && it.LoginTime <= logininfoDto.EndTime);
- exp.AndIF(logininfoDto.Ipaddr.IfNotEmpty(), f => f.Ipaddr == logininfoDto.Ipaddr);
- exp.AndIF(logininfoDto.UserName.IfNotEmpty(), f => f.UserName.Contains(logininfoDto.UserName));
- exp.AndIF(logininfoDto.Status.IfNotEmpty(), f => f.Status == logininfoDto.Status);
- var query = Context.Queryable()
- .Where(exp.ToExpression())
- .OrderBy(it => it.InfoId, OrderByType.Desc);
-
- return query.ToPage(pager);
- }
-
- ///
- /// 登录日志记录
- ///
- ///
- ///
- public void AddLoginInfo(SysLogininfor sysLogininfor)
- {
- int result = Context.Insertable(sysLogininfor)
- .ExecuteReturnIdentity();
- }
-
- ///
- /// 清空登录日志
- ///
- public void TruncateLogininfo()
- {
- string sql = "truncate table sys_logininfor";
-
- Context.Ado.ExecuteCommand(sql);
- }
-
- ///
- /// 删除登录日志
- ///
- ///
- ///
- public int DeleteLogininforByIds(long[] ids)
- {
- return Context.Deleteable().In(ids).ExecuteCommand();
- }
-
- ///
- /// 登录
- ///
- /// 登录实体
- ///
- public SysUser Login(LoginBodyDto user)
- {
- return Context.Queryable().First(it => it.UserName == user.Username && it.Password == user.Password);
- }
-
- ///
- /// 修改登录信息
- ///
- ///
- ///
- ///
- public void UpdateLoginInfo(LoginBodyDto user, long userId)
- {
- var db = Context;
- db.Updateable(new SysUser() { LoginIP = user.LoginIP, LoginDate = db.GetDate(), UserId = userId })
- .UpdateColumns(it => new { it.LoginIP, it.LoginDate })
- .ExecuteCommand();
- }
- }
-}
diff --git a/ZR.Repository/System/SysOperLogRepository.cs b/ZR.Repository/System/SysOperLogRepository.cs
deleted file mode 100644
index 81a1126..0000000
--- a/ZR.Repository/System/SysOperLogRepository.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using Infrastructure.Attribute;
-using Infrastructure.Extensions;
-using System.Collections.Generic;
-using ZR.Model;
-using ZR.Model.System.Dto;
-using ZR.Model.System;
-using SqlSugar;
-using Infrastructure.Model;
-
-namespace ZR.Repository.System
-{
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysOperLogRepository : BaseRepository
- {
- ///
- /// 查询操作日志
- ///
- ///
- /// 分页数据
- ///
- public PagedInfo GetSysOperLog(SysOperLogDto sysOper, PagerInfo pagerInfo)
- {
- var exp = Expressionable.Create();
- exp.And(it => it.OperTime >= sysOper.BeginTime && it.OperTime <= sysOper.EndTime);
- exp.AndIF(sysOper.Title.IfNotEmpty(), it => it.Title.Contains(sysOper.Title));
- exp.AndIF(sysOper.operName.IfNotEmpty(), it => it.OperName.Contains(sysOper.operName));
- exp.AndIF(sysOper.BusinessType != -1, it => it.BusinessType == sysOper.BusinessType);
- exp.AndIF(sysOper.Status != -1, it => it.Status == sysOper.Status);
-
- return GetPages(exp.ToExpression(), pagerInfo, x => x.OperId, OrderByType.Desc);
- }
-
- ///
- /// 添加操作日志
- ///
- ///
- ///
- public void AddSysOperLog(SysOperLog sysOperLog)
- {
- Context.Insertable(sysOperLog).ExecuteCommandAsync();
- }
-
- ///
- /// 清空日志
- ///
- public void ClearOperLog()
- {
- string sql = "truncate table sys_oper_log";
- Context.Ado.ExecuteCommand(sql);
- }
-
- ///
- /// 删除操作日志
- ///
- ///
- ///
- public int DeleteOperLogByIds(long[] operIds)
- {
- return Context.Deleteable().In(operIds).ExecuteCommand();
- }
-
- ///
- /// 查询操作日志
- ///
- ///
- ///
- public SysOperLog SelectOperLogById(long operId)
- {
- return Context.Queryable().InSingle(operId);
- }
- }
-}
diff --git a/ZR.Repository/System/SysPostRepository.cs b/ZR.Repository/System/SysPostRepository.cs
deleted file mode 100644
index cc12aa0..0000000
--- a/ZR.Repository/System/SysPostRepository.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Infrastructure.Attribute;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysPostRepository : BaseRepository
- {
- }
-}
diff --git a/ZR.Repository/System/SysTasksQzRepository.cs b/ZR.Repository/System/SysTasksQzRepository.cs
deleted file mode 100644
index a231073..0000000
--- a/ZR.Repository/System/SysTasksQzRepository.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Infrastructure.Attribute;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysTasksQzRepository: BaseRepository
- {
- }
-}
diff --git a/ZR.Repository/System/SysUserPostRepository.cs b/ZR.Repository/System/SysUserPostRepository.cs
deleted file mode 100644
index af85023..0000000
--- a/ZR.Repository/System/SysUserPostRepository.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Infrastructure.Attribute;
-using SqlSugar;
-using System.Collections.Generic;
-using ZR.Model.System;
-
-namespace ZR.Repository.System
-{
- ///
- /// 用户岗位
- ///
- [AppService(ServiceLifetime = LifeTime.Transient)]
- public class SysUserPostRepository : BaseRepository
- {
- ///
- /// 获取用户岗位
- ///
- ///
- ///
- public List SelectPostsByUserId(long userId)
- {
- return Context.Queryable((p, up) => new JoinQueryInfos(
- JoinType.Left, up.PostId == p.PostId
- )).Where((p, up) => up.UserId == userId)
- .Select().ToList();
- }
- }
-}
diff --git a/ZR.Repository/ZR.Repository.csproj b/ZR.Repository/ZR.Repository.csproj
index 1744cb2..b12346e 100644
--- a/ZR.Repository/ZR.Repository.csproj
+++ b/ZR.Repository/ZR.Repository.csproj
@@ -4,21 +4,6 @@
net6.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-