zhupei 4 anos atrás
pai
commit
6d551b9867

+ 1 - 0
RMYY_CallCenter_Api.Bll/RMYY_CallCenter_Api.Bll.csproj

@@ -61,6 +61,7 @@
61 61
     <Compile Include="T_Hos_WorkOrderItem.cs" />
62 62
     <Compile Include="T_Mat_WorkOrder.cs" />
63 63
     <Compile Include="T_Mat_WorkOrderItem.cs" />
64
+    <Compile Include="T_Sys_Accessories.cs" />
64 65
     <Compile Include="T_Sys_Department.cs" />
65 66
     <Compile Include="T_Sys_DictionaryBase.cs" />
66 67
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 141 - 0
RMYY_CallCenter_Api.Bll/T_Sys_Accessories.cs

@@ -0,0 +1,141 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace RMYY_CallCenter_Api.Bll
9
+{
10
+    /// <summary>
11
+    /// 附件表
12
+    /// </summary>
13
+    public partial class T_Sys_Accessories
14
+    {
15
+        private readonly RMYY_CallCenter_Api.Dal.T_Sys_Accessories dal = new RMYY_CallCenter_Api.Dal.T_Sys_Accessories();
16
+        public T_Sys_Accessories()
17
+        { }
18
+        #region  BasicMethod
19
+        /// <summary>
20
+        /// 是否存在该记录
21
+        /// </summary>
22
+        public bool Exists(int F_FileId)
23
+        {
24
+            return dal.Exists(F_FileId);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 增加一条数据
29
+        /// </summary>
30
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_Accessories model)
31
+        {
32
+            return dal.Add(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 更新一条数据
37
+        /// </summary>
38
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_Accessories model)
39
+        {
40
+            return dal.Update(model);
41
+        }
42
+
43
+        /// <summary>
44
+        /// 删除一条数据
45
+        /// </summary>
46
+        public bool Delete(int F_FileId)
47
+        {
48
+
49
+            return dal.Delete(F_FileId);
50
+        }
51
+        /// <summary>
52
+        /// 删除一条数据
53
+        /// </summary>
54
+        public bool DeleteList(string F_FileIdlist)
55
+        {
56
+            return dal.DeleteList(F_FileIdlist);
57
+        }
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public RMYY_CallCenter_Api.Model.T_Sys_Accessories GetModel(int F_FileId)
63
+        {
64
+
65
+            return dal.GetModel(F_FileId);
66
+        }
67
+
68
+        /// <summary>
69
+        /// 获得数据列表
70
+        /// </summary>
71
+        public DataSet GetList(string strWhere)
72
+        {
73
+            return dal.GetList(strWhere);
74
+        }
75
+        /// <summary>
76
+        /// 获得前几行数据
77
+        /// </summary>
78
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
79
+        {
80
+            return dal.GetList(Top, strWhere, filedOrder);
81
+        }
82
+        /// <summary>
83
+        /// 获得数据列表
84
+        /// </summary>
85
+        public List<RMYY_CallCenter_Api.Model.T_Sys_Accessories> GetModelList(string strWhere)
86
+        {
87
+            DataSet ds = dal.GetList(strWhere);
88
+            return DataTableToList(ds.Tables[0]);
89
+        }
90
+        /// <summary>
91
+        /// 获得数据列表
92
+        /// </summary>
93
+        public List<RMYY_CallCenter_Api.Model.T_Sys_Accessories> DataTableToList(DataTable dt)
94
+        {
95
+            List<RMYY_CallCenter_Api.Model.T_Sys_Accessories> modelList = new List<RMYY_CallCenter_Api.Model.T_Sys_Accessories>();
96
+            int rowsCount = dt.Rows.Count;
97
+            if (rowsCount > 0)
98
+            {
99
+                RMYY_CallCenter_Api.Model.T_Sys_Accessories model;
100
+                for (int n = 0; n < rowsCount; n++)
101
+                {
102
+                    model = dal.DataRowToModel(dt.Rows[n]);
103
+                    if (model != null)
104
+                    {
105
+                        modelList.Add(model);
106
+                    }
107
+                }
108
+            }
109
+            return modelList;
110
+        }
111
+
112
+        /// <summary>
113
+        /// 获得数据列表
114
+        /// </summary>
115
+        public DataSet GetAllList()
116
+        {
117
+            return GetList("");
118
+        }
119
+
120
+        /// <summary>
121
+        /// 分页获取数据列表
122
+        /// </summary>
123
+        public int GetRecordCount(string strWhere)
124
+        {
125
+            return dal.GetRecordCount(strWhere);
126
+        }
127
+        /// <summary>
128
+        /// 分页获取数据列表
129
+        /// </summary>
130
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
131
+        {
132
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
133
+        }
134
+      
135
+
136
+        #endregion  BasicMethod
137
+        #region  ExtensionMethod
138
+
139
+        #endregion  ExtensionMethod
140
+    }
141
+}

+ 1 - 0
RMYY_CallCenter_Api.Dal/RMYY_CallCenter_Api.Dal.csproj

@@ -61,6 +61,7 @@
61 61
     <Compile Include="T_Hos_WorkOrderItem.cs" />
62 62
     <Compile Include="T_Mat_WorkOrder.cs" />
63 63
     <Compile Include="T_Mat_WorkOrderItem.cs" />
64
+    <Compile Include="T_Sys_Accessories.cs" />
64 65
     <Compile Include="T_Sys_Department.cs" />
65 66
     <Compile Include="T_Sys_DictionaryBase.cs" />
66 67
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 322 - 0
RMYY_CallCenter_Api.Dal/T_Sys_Accessories.cs

@@ -0,0 +1,322 @@
1
+using RMYY_CallCenter_Api.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace RMYY_CallCenter_Api.Dal
11
+{
12
+    /// <summary>
13
+    /// 数据访问类:T_Sys_Accessories
14
+    /// </summary>
15
+    public partial class T_Sys_Accessories
16
+    {
17
+        public T_Sys_Accessories()
18
+        { }
19
+        #region  BasicMethod
20
+        /// <summary>
21
+        /// 是否存在该记录
22
+        /// </summary>
23
+        public bool Exists(int F_FileId)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("select count(1) from T_Sys_Accessories");
27
+            strSql.Append(" where F_FileId=@F_FileId");
28
+            SqlParameter[] parameters = {
29
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4)
30
+            };
31
+            parameters[0].Value = F_FileId;
32
+
33
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
34
+        }
35
+
36
+
37
+        /// <summary>
38
+        /// 增加一条数据
39
+        /// </summary>
40
+        public int Add(RMYY_CallCenter_Api.Model.T_Sys_Accessories model)
41
+        {
42
+            StringBuilder strSql = new StringBuilder();
43
+            strSql.Append("insert into T_Sys_Accessories(");
44
+            strSql.Append("F_FileName,F_FileType,F_FileUrl,F_UserCode,F_AddTime,F_Size,F_OriName)");
45
+            strSql.Append(" values (");
46
+            strSql.Append("@F_FileName,@F_FileType,@F_FileUrl,@F_UserCode,@F_AddTime,@F_Size,@F_OriName)");
47
+            strSql.Append(";select @@IDENTITY");
48
+            SqlParameter[] parameters = {
49
+                    new SqlParameter("@F_FileName", SqlDbType.NVarChar,100),
50
+                    new SqlParameter("@F_FileType", SqlDbType.NVarChar,20),
51
+                    new SqlParameter("@F_FileUrl", SqlDbType.NVarChar,200),
52
+                    new SqlParameter("@F_UserCode", SqlDbType.NVarChar,20),
53
+                    new SqlParameter("@F_AddTime", SqlDbType.DateTime),
54
+                    new SqlParameter("@F_Size", SqlDbType.BigInt,8),
55
+                    new SqlParameter("@F_OriName", SqlDbType.NVarChar,500)};
56
+            parameters[0].Value = model.F_FileName;
57
+            parameters[1].Value = model.F_FileType;
58
+            parameters[2].Value = model.F_FileUrl;
59
+            parameters[3].Value = model.F_UserCode;
60
+            parameters[4].Value = model.F_AddTime;
61
+            parameters[5].Value = model.F_Size;
62
+            parameters[6].Value = model.F_OriName;
63
+
64
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
65
+            if (obj == null)
66
+            {
67
+                return 0;
68
+            }
69
+            else
70
+            {
71
+                return Convert.ToInt32(obj);
72
+            }
73
+        }
74
+        /// <summary>
75
+        /// 更新一条数据
76
+        /// </summary>
77
+        public bool Update(RMYY_CallCenter_Api.Model.T_Sys_Accessories model)
78
+        {
79
+            StringBuilder strSql = new StringBuilder();
80
+            strSql.Append("update T_Sys_Accessories set ");
81
+            strSql.Append("F_FileName=@F_FileName,");
82
+            strSql.Append("F_FileType=@F_FileType,");
83
+            strSql.Append("F_FileUrl=@F_FileUrl,");
84
+            strSql.Append("F_UserCode=@F_UserCode,");
85
+            strSql.Append("F_AddTime=@F_AddTime,");
86
+            strSql.Append("F_Size=@F_Size,");
87
+            strSql.Append("F_OriName=@F_OriName");
88
+            strSql.Append(" where F_FileId=@F_FileId");
89
+            SqlParameter[] parameters = {
90
+                    new SqlParameter("@F_FileName", SqlDbType.NVarChar,100),
91
+                    new SqlParameter("@F_FileType", SqlDbType.NVarChar,20),
92
+                    new SqlParameter("@F_FileUrl", SqlDbType.NVarChar,200),
93
+                    new SqlParameter("@F_UserCode", SqlDbType.NVarChar,20),
94
+                    new SqlParameter("@F_AddTime", SqlDbType.DateTime),
95
+                    new SqlParameter("@F_Size", SqlDbType.BigInt,8),
96
+                    new SqlParameter("@F_OriName", SqlDbType.NVarChar,500),
97
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4)};
98
+            parameters[0].Value = model.F_FileName;
99
+            parameters[1].Value = model.F_FileType;
100
+            parameters[2].Value = model.F_FileUrl;
101
+            parameters[3].Value = model.F_UserCode;
102
+            parameters[4].Value = model.F_AddTime;
103
+            parameters[5].Value = model.F_Size;
104
+            parameters[6].Value = model.F_OriName;
105
+            parameters[7].Value = model.F_FileId;
106
+
107
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
108
+            if (rows > 0)
109
+            {
110
+                return true;
111
+            }
112
+            else
113
+            {
114
+                return false;
115
+            }
116
+        }
117
+
118
+        /// <summary>
119
+        /// 删除一条数据
120
+        /// </summary>
121
+        public bool Delete(int F_FileId)
122
+        {
123
+
124
+            StringBuilder strSql = new StringBuilder();
125
+            strSql.Append("delete from T_Sys_Accessories ");
126
+            strSql.Append(" where F_FileId=@F_FileId");
127
+            SqlParameter[] parameters = {
128
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4)
129
+            };
130
+            parameters[0].Value = F_FileId;
131
+
132
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
133
+            if (rows > 0)
134
+            {
135
+                return true;
136
+            }
137
+            else
138
+            {
139
+                return false;
140
+            }
141
+        }
142
+        /// <summary>
143
+        /// 批量删除数据
144
+        /// </summary>
145
+        public bool DeleteList(string F_FileIdlist)
146
+        {
147
+            StringBuilder strSql = new StringBuilder();
148
+            strSql.Append("delete from T_Sys_Accessories ");
149
+            strSql.Append(" where F_FileId in (" + F_FileIdlist + ")  ");
150
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
151
+            if (rows > 0)
152
+            {
153
+                return true;
154
+            }
155
+            else
156
+            {
157
+                return false;
158
+            }
159
+        }
160
+
161
+
162
+        /// <summary>
163
+        /// 得到一个对象实体
164
+        /// </summary>
165
+        public RMYY_CallCenter_Api.Model.T_Sys_Accessories GetModel(int F_FileId)
166
+        {
167
+
168
+            StringBuilder strSql = new StringBuilder();
169
+            strSql.Append("select  top 1 F_FileId,F_FileName,F_FileType,F_FileUrl,F_UserCode,F_AddTime,F_Size,F_OriName from T_Sys_Accessories ");
170
+            strSql.Append(" where F_FileId=@F_FileId");
171
+            SqlParameter[] parameters = {
172
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4)
173
+            };
174
+            parameters[0].Value = F_FileId;
175
+
176
+            RMYY_CallCenter_Api.Model.T_Sys_Accessories model = new RMYY_CallCenter_Api.Model.T_Sys_Accessories();
177
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
178
+            if (ds.Tables[0].Rows.Count > 0)
179
+            {
180
+                return DataRowToModel(ds.Tables[0].Rows[0]);
181
+            }
182
+            else
183
+            {
184
+                return null;
185
+            }
186
+        }
187
+
188
+
189
+        /// <summary>
190
+        /// 得到一个对象实体
191
+        /// </summary>
192
+        public RMYY_CallCenter_Api.Model.T_Sys_Accessories DataRowToModel(DataRow row)
193
+        {
194
+            RMYY_CallCenter_Api.Model.T_Sys_Accessories model = new RMYY_CallCenter_Api.Model.T_Sys_Accessories();
195
+            if (row != null)
196
+            {
197
+                if (row["F_FileId"] != null && row["F_FileId"].ToString() != "")
198
+                {
199
+                    model.F_FileId = int.Parse(row["F_FileId"].ToString());
200
+                }
201
+                if (row["F_FileName"] != null)
202
+                {
203
+                    model.F_FileName = row["F_FileName"].ToString();
204
+                }
205
+                if (row["F_FileType"] != null)
206
+                {
207
+                    model.F_FileType = row["F_FileType"].ToString();
208
+                }
209
+                if (row["F_FileUrl"] != null)
210
+                {
211
+                    model.F_FileUrl = row["F_FileUrl"].ToString();
212
+                }
213
+                if (row["F_UserCode"] != null)
214
+                {
215
+                    model.F_UserCode = row["F_UserCode"].ToString();
216
+                }
217
+                if (row["F_AddTime"] != null && row["F_AddTime"].ToString() != "")
218
+                {
219
+                    model.F_AddTime = DateTime.Parse(row["F_AddTime"].ToString());
220
+                }
221
+                if (row["F_Size"] != null && row["F_Size"].ToString() != "")
222
+                {
223
+                    model.F_Size = long.Parse(row["F_Size"].ToString());
224
+                }
225
+                if (row["F_OriName"] != null)
226
+                {
227
+                    model.F_OriName = row["F_OriName"].ToString();
228
+                }
229
+            }
230
+            return model;
231
+        }
232
+
233
+        /// <summary>
234
+        /// 获得数据列表
235
+        /// </summary>
236
+        public DataSet GetList(string strWhere)
237
+        {
238
+            StringBuilder strSql = new StringBuilder();
239
+            strSql.Append("select F_FileId,F_FileName,F_FileType,F_FileUrl,F_UserCode,F_AddTime,F_Size,F_OriName ");
240
+            strSql.Append(" FROM T_Sys_Accessories ");
241
+            if (strWhere.Trim() != "")
242
+            {
243
+                strSql.Append(" where " + strWhere);
244
+            }
245
+            return DbHelperSQL.Query(strSql.ToString());
246
+        }
247
+
248
+        /// <summary>
249
+        /// 获得前几行数据
250
+        /// </summary>
251
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
252
+        {
253
+            StringBuilder strSql = new StringBuilder();
254
+            strSql.Append("select ");
255
+            if (Top > 0)
256
+            {
257
+                strSql.Append(" top " + Top.ToString());
258
+            }
259
+            strSql.Append(" F_FileId,F_FileName,F_FileType,F_FileUrl,F_UserCode,F_AddTime,F_Size,F_OriName ");
260
+            strSql.Append(" FROM T_Sys_Accessories ");
261
+            if (strWhere.Trim() != "")
262
+            {
263
+                strSql.Append(" where " + strWhere);
264
+            }
265
+            strSql.Append(" order by " + filedOrder);
266
+            return DbHelperSQL.Query(strSql.ToString());
267
+        }
268
+
269
+        /// <summary>
270
+        /// 获取记录总数
271
+        /// </summary>
272
+        public int GetRecordCount(string strWhere)
273
+        {
274
+            StringBuilder strSql = new StringBuilder();
275
+            strSql.Append("select count(1) FROM T_Sys_Accessories ");
276
+            if (strWhere.Trim() != "")
277
+            {
278
+                strSql.Append(" where " + strWhere);
279
+            }
280
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
281
+            if (obj == null)
282
+            {
283
+                return 0;
284
+            }
285
+            else
286
+            {
287
+                return Convert.ToInt32(obj);
288
+            }
289
+        }
290
+        /// <summary>
291
+        /// 分页获取数据列表
292
+        /// </summary>
293
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
294
+        {
295
+            StringBuilder strSql = new StringBuilder();
296
+            strSql.Append("SELECT * FROM ( ");
297
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
298
+            if (!string.IsNullOrEmpty(orderby.Trim()))
299
+            {
300
+                strSql.Append("order by T." + orderby);
301
+            }
302
+            else
303
+            {
304
+                strSql.Append("order by T.F_FileId desc");
305
+            }
306
+            strSql.Append(")AS Row, T.*  from T_Sys_Accessories T ");
307
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
308
+            {
309
+                strSql.Append(" WHERE " + strWhere);
310
+            }
311
+            strSql.Append(" ) TT");
312
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
313
+            return DbHelperSQL.Query(strSql.ToString());
314
+        }
315
+
316
+     
317
+        #endregion  BasicMethod
318
+        #region  ExtensionMethod
319
+
320
+        #endregion  ExtensionMethod
321
+    }
322
+}

+ 1 - 0
RMYY_CallCenter_Api.Model/RMYY_CallCenter_Api.Model.csproj

@@ -60,6 +60,7 @@
60 60
     <Compile Include="T_Hos_WorkOrderItem.cs" />
61 61
     <Compile Include="T_Mat_WorkOrder.cs" />
62 62
     <Compile Include="T_Mat_WorkOrderItem.cs" />
63
+    <Compile Include="T_Sys_Accessories.cs" />
63 64
     <Compile Include="T_Sys_Department.cs" />
64 65
     <Compile Include="T_Sys_DictionaryBase.cs" />
65 66
     <Compile Include="T_Sys_DictionaryValue.cs" />

+ 93 - 0
RMYY_CallCenter_Api.Model/T_Sys_Accessories.cs

@@ -0,0 +1,93 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace RMYY_CallCenter_Api.Model
8
+{
9
+    /// <summary>
10
+    /// 附件表
11
+    /// </summary>
12
+    [Serializable]
13
+    public partial class T_Sys_Accessories
14
+    {
15
+        public T_Sys_Accessories()
16
+        { }
17
+        #region Model
18
+        private int _f_fileid;
19
+        private string _f_filename;
20
+        private string _f_filetype;
21
+        private string _f_fileurl;
22
+        private string _f_usercode;
23
+        private DateTime? _f_addtime;
24
+        private long? _f_size;
25
+        private string _f_oriname;
26
+        /// <summary>
27
+        /// 附件id
28
+        /// </summary>
29
+        public int F_FileId
30
+        {
31
+            set { _f_fileid = value; }
32
+            get { return _f_fileid; }
33
+        }
34
+        /// <summary>
35
+        /// 附件名称
36
+        /// </summary>
37
+        public string F_FileName
38
+        {
39
+            set { _f_filename = value; }
40
+            get { return _f_filename; }
41
+        }
42
+        /// <summary>
43
+        /// 附件类型(后缀名)
44
+        /// </summary>
45
+        public string F_FileType
46
+        {
47
+            set { _f_filetype = value; }
48
+            get { return _f_filetype; }
49
+        }
50
+        /// <summary>
51
+        /// 上传路径
52
+        /// </summary>
53
+        public string F_FileUrl
54
+        {
55
+            set { _f_fileurl = value; }
56
+            get { return _f_fileurl; }
57
+        }
58
+        /// <summary>
59
+        /// 添加人工号
60
+        /// </summary>
61
+        public string F_UserCode
62
+        {
63
+            set { _f_usercode = value; }
64
+            get { return _f_usercode; }
65
+        }
66
+        /// <summary>
67
+        /// 上传时间
68
+        /// </summary>
69
+        public DateTime? F_AddTime
70
+        {
71
+            set { _f_addtime = value; }
72
+            get { return _f_addtime; }
73
+        }
74
+        /// <summary>
75
+        /// 附件大小
76
+        /// </summary>
77
+        public long? F_Size
78
+        {
79
+            set { _f_size = value; }
80
+            get { return _f_size; }
81
+        }
82
+        /// <summary>
83
+        /// 文件原名
84
+        /// </summary>
85
+        public string F_OriName
86
+        {
87
+            set { _f_oriname = value; }
88
+            get { return _f_oriname; }
89
+        }
90
+        #endregion Model
91
+
92
+    }
93
+}