You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

676 lines
26 KiB

  1. using NFine.Code;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Data.Common;
  7. using System.Data.SqlClient;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace NFine.Repository
  12. {
  13. public interface IRepository<T> where T : new()
  14. {
  15. #region 事务
  16. /// <summary>
  17. /// 事务开始
  18. /// </summary>
  19. /// <returns></returns>
  20. DbTransaction BeginTrans();
  21. /// <summary>
  22. /// 提交事务
  23. /// </summary>
  24. void Commit();
  25. /// <summary>
  26. /// 回滚事务
  27. /// </summary>
  28. void Rollback();
  29. /// <summary>
  30. /// 关闭数据库连接
  31. /// </summary>
  32. void Close();
  33. #endregion
  34. #region SqlBulkCopy大批量数据插入
  35. /// <summary>
  36. /// 大批量数据插入
  37. /// </summary>
  38. /// <param name="datatable">资料表</param>
  39. /// <returns></returns>
  40. bool BulkInsert(DataTable datatable);
  41. #endregion
  42. #region 执行SQL语句
  43. /// <summary>
  44. /// 执行SQL语句
  45. /// </summary>
  46. /// <param name="strSql">Sql语句</param>
  47. /// <returns></returns>
  48. int ExecuteBySql(StringBuilder strSql);
  49. /// <summary>
  50. /// 执行SQL语句
  51. /// </summary>
  52. /// <param name="strSql">Sql语句</param>
  53. /// <returns></returns>
  54. int ExecuteBySql_Other(StringBuilder strSql, string Connect);
  55. /// <summary>
  56. /// 执行SQL语句
  57. /// </summary>
  58. /// <param name="strSql">Sql语句</param>
  59. /// <param name="isOpenTrans">事务对象</param>
  60. /// <returns></returns>
  61. int ExecuteBySql(StringBuilder strSql, DbTransaction isOpenTrans);
  62. /// <summary>
  63. /// 执行SQL语句
  64. /// </summary>
  65. /// <param name="strSql">Sql语句</param>
  66. /// <param name="parameters">sql语句对应参数</param>
  67. /// <returns></returns>
  68. int ExecuteBySql(StringBuilder strSql, DbParameter[] parameters);
  69. /// <summary>
  70. /// 执行SQL语句
  71. /// </summary>
  72. /// <param name="strSql">Sql语句</param>
  73. /// <param name="parameters">sql语句对应参数</param>
  74. /// <param name="isOpenTrans">事务对象</param>
  75. /// <returns></returns>
  76. int ExecuteBySql(StringBuilder strSql, DbParameter[] parameters, DbTransaction isOpenTrans);
  77. #endregion
  78. #region 执行存储过程
  79. /// <summary>
  80. /// 执行存储过程
  81. /// </summary>
  82. /// <param name="procName">存储过程</param>
  83. /// <returns></returns>
  84. int ExecuteByProc(string procName);
  85. /// <summary>
  86. /// 执行存储过程
  87. /// </summary>
  88. /// <param name="procName">存储过程</param>
  89. /// <param name="isOpenTrans">事务对象</param>
  90. /// <returns></returns>
  91. int ExecuteByProc(string procName, DbTransaction isOpenTrans);
  92. /// <summary>
  93. /// 执行存储过程
  94. /// </summary>
  95. /// <param name="procName">存储过程</param>
  96. /// <param name="parameters">sql语句对应参数</param>
  97. /// <returns></returns>
  98. int ExecuteByProc(string procName, DbParameter[] parameters);
  99. /// <summary>
  100. /// 执行存储过程
  101. /// </summary>
  102. /// <param name="procName">存储过程</param>
  103. /// <param name="parameters">sql语句对应参数</param>
  104. /// <param name="isOpenTrans">事务对象</param>
  105. /// <returns></returns>
  106. int ExecuteByProc(string procName, DbParameter[] parameters, DbTransaction isOpenTrans);
  107. #endregion
  108. #region 插入数据
  109. /// <summary>
  110. /// 插入数据
  111. /// </summary>
  112. /// <param name="entity">实体类对象</param>
  113. /// <returns></returns>
  114. int Insert(T entity);
  115. /// <summary>
  116. /// 插入数据
  117. /// </summary>
  118. /// <param name="entity">实体类对象</param>
  119. /// <param name="isOpenTrans">事务对象</param>
  120. /// <returns></returns>
  121. int Insert(T entity, DbTransaction isOpenTrans);
  122. /// <summary>
  123. /// 批量插入数据
  124. /// </summary>
  125. /// <param name="entity">实体类对象</param>
  126. /// <returns></returns>
  127. int Insert(List<T> entity);
  128. /// <summary>
  129. /// 批量插入数据
  130. /// </summary>
  131. /// <param name="entity">实体类对象</param>
  132. /// <param name="isOpenTrans">事务对象</param>
  133. /// <returns></returns>
  134. int Insert(List<T> entity, DbTransaction isOpenTrans);
  135. #endregion
  136. #region 修改数据
  137. /// <summary>
  138. /// 修改数据
  139. /// </summary>
  140. /// <param name="entity">实体对象</param>
  141. /// <returns></returns>
  142. int Update(T entity);
  143. /// <summary>
  144. /// 修改数据
  145. /// </summary>
  146. /// <param name="entity">实体对象</param>
  147. /// <param name="isOpenTrans">事务对象</param>
  148. /// <returns></returns>
  149. int Update(T entity, DbTransaction isOpenTrans);
  150. /// <summary>
  151. /// 修改数据
  152. /// </summary>
  153. /// <param name="propertyName">实体属性名称</param>
  154. /// <param name="propertyValue">字段值</param>
  155. /// <returns></returns>
  156. int Update(string propertyName, string propertyValue);
  157. /// <summary>
  158. /// 修改数据
  159. /// </summary>
  160. /// <param name="propertyName">实体属性名称</param>
  161. /// <param name="propertyValue">字段值</param>
  162. /// <param name="isOpenTrans">事务对象</param>
  163. /// <returns></returns>
  164. int Update(string propertyName, string propertyValue, DbTransaction isOpenTrans);
  165. /// <summary>
  166. /// 批量修改数据
  167. /// </summary>
  168. /// <param name="entity">实体对象</param>
  169. /// <returns></returns>
  170. int Update(List<T> entity);
  171. /// <summary>
  172. /// 批量修改数据
  173. /// </summary>
  174. /// <param name="entity">实体对象</param>
  175. /// <param name="isOpenTrans">事务对象</param>
  176. /// <returns></returns>
  177. int Update(List<T> entity, DbTransaction isOpenTrans);
  178. #endregion
  179. #region 删除数据
  180. /// <summary>
  181. /// 删除数据
  182. /// </summary>
  183. /// <param name="entity">实体类</param>
  184. /// <returns></returns>
  185. int Delete(T entity);
  186. /// <summary>
  187. /// 删除数据
  188. /// </summary>
  189. /// <param name="entity">实体类</param>
  190. /// <param name="isOpenTrans">事务对象</param>
  191. /// <returns></returns>
  192. int Delete(T entity, DbTransaction isOpenTrans);
  193. /// <summary>
  194. /// 删除数据
  195. /// </summary>
  196. /// <param name="propertyValue">主键值</param>
  197. /// <returns></returns>
  198. int Delete(object propertyValue);
  199. /// <summary>
  200. /// 删除数据
  201. /// </summary>
  202. /// <param name="propertyValue">主键值</param>
  203. /// <param name="isOpenTrans">事务对象</param>
  204. /// <returns></returns>
  205. int Delete(object propertyValue, DbTransaction isOpenTrans);
  206. /// <summary>
  207. /// 删除数据
  208. /// </summary>
  209. /// <param name="propertyName">实体属性名称</param>
  210. /// <param name="propertyValue">字段值</param>
  211. /// <returns></returns>
  212. int Delete(string propertyName, string propertyValue);
  213. /// <summary>
  214. /// 删除数据
  215. /// </summary>
  216. /// <param name="propertyName">实体属性名称</param>
  217. /// <param name="propertyValue">字段值</param>
  218. /// <param name="isOpenTrans">事务对象</param>
  219. /// <returns></returns>
  220. int Delete(string propertyName, string propertyValue, DbTransaction isOpenTrans);
  221. /// <summary>
  222. /// 删除数据
  223. /// </summary>
  224. /// <param name="tableName">表名</param>
  225. /// <param name="ht">键值生成SQL条件</param>
  226. /// <returns></returns>
  227. int Delete(string tableName, Hashtable ht);
  228. /// <summary>
  229. /// 删除数据
  230. /// </summary>
  231. /// <param name="tableName">表名</param>
  232. /// <param name="ht">键值生成SQL条件</param>
  233. /// <param name="isOpenTrans">事务对象</param>
  234. /// <returns></returns>
  235. int Delete(string tableName, Hashtable ht, DbTransaction isOpenTrans);
  236. /// <summary>
  237. /// 批量删除数据
  238. /// </summary>
  239. /// <param name="propertyValue">主键值:数组1,2,3,4,5,6.....</param>
  240. /// <returns></returns>
  241. int Delete(object[] propertyValue);
  242. /// <summary>
  243. /// 批量删除数据
  244. /// </summary>
  245. /// <param name="propertyValue">主键值:数组1,2,3,4,5,6.....</param>
  246. /// <param name="isOpenTrans">事务对象</param>
  247. /// <returns></returns>
  248. int Delete(object[] propertyValue, DbTransaction isOpenTrans);
  249. /// <summary>
  250. /// 批量删除数据
  251. /// </summary>
  252. /// <param name="propertyName">实体属性名称</param>
  253. /// <param name="propertyValue">字段值:数组1,2,3,4,5,6.....</param>
  254. /// <returns></returns>
  255. int Delete(string propertyName, object[] propertyValue);
  256. /// <summary>
  257. /// 批量删除数据
  258. /// </summary>
  259. /// <param name="propertyName">实体属性名称</param>
  260. /// <param name="propertyValue">字段值:数组1,2,3,4,5,6.....</param>
  261. /// <param name="isOpenTrans">事务对象</param>
  262. /// <returns></returns>
  263. int Delete(string propertyName, object[] propertyValue, DbTransaction isOpenTrans);
  264. #endregion
  265. #region 查询数据列表、返回List
  266. /// <summary>
  267. /// 查询数据列表、返回List
  268. /// </summary>
  269. /// <param name="Top">显示条数</param>
  270. /// <returns></returns>
  271. List<T> FindListTop(int Top);
  272. /// <summary>
  273. /// 查询数据列表、返回List
  274. /// </summary>
  275. /// <param name="Top">显示条数</param>
  276. /// <param name="propertyName">实体属性名称</param>
  277. /// <param name="propertyValue">字段值</param>
  278. /// <returns></returns>
  279. List<T> FindListTop(int Top, string propertyName, string propertyValue);
  280. /// <summary>
  281. /// 查询数据列表、返回List
  282. /// </summary>
  283. /// <param name="Top">显示条数</param>
  284. /// <param name="WhereSql">条件</param>
  285. /// <returns></returns>
  286. List<T> FindListTop(int Top, string WhereSql);
  287. /// <summary>
  288. /// 查询数据列表、返回List
  289. /// </summary>
  290. /// <param name="Top">显示条数</param>
  291. /// <param name="WhereSql">条件</param>
  292. /// <param name="parameters">sql语句对应参数</param>
  293. /// <returns></returns>
  294. List<T> FindListTop(int Top, string WhereSql, DbParameter[] parameters);
  295. /// <summary>
  296. /// 查询数据列表、返回List
  297. /// </summary>
  298. /// <returns></returns>
  299. List<T> FindList();
  300. /// <summary>
  301. /// 查询数据列表、返回List
  302. /// </summary>
  303. /// <param name="propertyName">实体属性名称</param>
  304. /// <param name="propertyValue">字段值</param>
  305. /// <returns></returns>
  306. List<T> FindList(string propertyName, string propertyValue);
  307. /// <summary>
  308. /// 查询数据列表、返回List
  309. /// </summary>
  310. /// <param name="WhereSql">条件</param>
  311. /// <returns></returns>
  312. List<T> FindList(string WhereSql);
  313. /// <summary>
  314. /// 查询数据列表、返回List
  315. /// </summary>
  316. /// <param name="WhereSql">条件</param>
  317. /// <param name="parameters">sql语句对应参数</param>
  318. /// <returns></returns>
  319. List<T> FindList(string WhereSql, DbParameter[] parameters);
  320. /// <summary>
  321. /// 查询数据列表、返回List
  322. /// </summary>
  323. /// <param name="strSql">Sql语句</param>
  324. /// <returns></returns>
  325. List<T> FindListBySql(string strSql);
  326. /// <summary>
  327. /// 查询数据列表、返回List
  328. /// </summary>
  329. /// <param name="strSql">Sql语句</param>
  330. /// <param name="parameters">sql语句对应参数</param>
  331. /// <returns></returns>
  332. List<T> FindListBySql(string strSql, DbParameter[] parameters);
  333. /// <summary>
  334. /// 查询数据列表、返回List
  335. /// </summary>
  336. /// <param name="Pagination">分页参数</param>
  337. /// <returns></returns>
  338. List<T> FindListPage(ref Pagination Pagination);
  339. /// <summary>
  340. /// 查询数据列表、返回List
  341. /// </summary>
  342. /// <param name="WhereSql">条件</param>
  343. /// <param name="Pagination">分页参数</param>
  344. /// <returns></returns>
  345. List<T> FindListPage(string WhereSql, ref Pagination Pagination);
  346. /// <summary>
  347. /// 查询数据列表、返回List
  348. /// </summary>
  349. /// <param name="WhereSql">条件</param>
  350. /// <param name="parameters">sql语句对应参数</param>
  351. /// <param name="Pagination">分页参数</param>
  352. /// <returns></returns>
  353. List<T> FindListPage(string WhereSql, DbParameter[] parameters, ref Pagination Pagination);
  354. /// <summary>
  355. /// 查询数据列表、返回List
  356. /// </summary>
  357. /// <param name="strSql">Sql语句</param>
  358. /// <param name="Pagination">分页参数</param>
  359. /// <returns></returns>
  360. List<T> FindListPageBySql(string strSql, ref Pagination Pagination);
  361. /// <summary>
  362. /// 查询数据列表、返回List
  363. /// </summary>
  364. /// <param name="strSql">Sql语句</param>
  365. /// <param name="Pagination">分页参数</param>
  366. /// <returns></returns>
  367. List<T> FindListPageBySql(string strSql, DbParameter[] parameters, ref Pagination Pagination);
  368. #endregion
  369. #region 查询数据列表、返回DataTable
  370. /// <summary>
  371. /// 查询数据列表、返回 DataTable
  372. /// </summary>
  373. /// <param name="Top">显示条数</param>
  374. /// <returns></returns>
  375. DataTable FindTableTop(int Top);
  376. /// <summary>
  377. /// 查询数据列表、返回 DataTable
  378. /// </summary>
  379. /// <param name="Top">显示条数</param>
  380. /// <param name="WhereSql">条件</param>
  381. /// <returns></returns>
  382. DataTable FindTableTop(int Top, string WhereSql);
  383. /// <summary>
  384. /// 查询数据列表、返回 DataTable
  385. /// </summary>
  386. /// <param name="Top">显示条数</param>
  387. /// <param name="WhereSql">条件</param>
  388. /// <param name="parameters">sql语句对应参数</param>
  389. /// <returns></returns>
  390. DataTable FindTableTop(int Top, string WhereSql, DbParameter[] parameters);
  391. /// <summary>
  392. /// 查询数据列表、返回 DataTable
  393. /// </summary>
  394. /// <returns></returns>
  395. DataTable FindTable();
  396. /// <summary>
  397. /// 查询数据列表、返回 DataTable
  398. /// </summary>
  399. /// <param name="WhereSql">条件</param>
  400. /// <returns></returns>
  401. DataTable FindTable(string WhereSql);
  402. /// <summary>
  403. /// 查询数据列表、返回 DataTable
  404. /// </summary>
  405. /// <param name="WhereSql">条件</param>
  406. /// <param name="parameters">sql语句对应参数</param>
  407. /// <returns></returns>
  408. DataTable FindTable(string WhereSql, DbParameter[] parameters);
  409. /// <summary>
  410. /// 查询数据列表、返回 DataTable
  411. /// </summary>
  412. /// <param name="strSql">Sql语句</param>
  413. /// <returns></returns>
  414. DataTable FindTableBySql(string strSql);
  415. /// <summary>
  416. /// 查询数据列表、返回 DataTable
  417. /// </summary>
  418. /// <param name="strSql">Sql语句</param>
  419. /// <param name="parameters">sql语句对应参数</param>
  420. /// <returns></returns>
  421. DataTable FindTableBySql(string strSql, DbParameter[] parameters);
  422. /// <summary>
  423. /// 查询数据列表、返回 DataTable
  424. /// </summary>
  425. /// <param name="orderField">排序字段</param>
  426. /// <param name="orderType">排序类型</param>
  427. /// <param name="pageIndex">当前页</param>
  428. /// <param name="pageSize">页大小</param>
  429. /// <param name="recordCount">返回查询条数</param>
  430. /// <returns></returns>
  431. DataTable FindTablePage(ref Pagination Pagination);
  432. /// <summary>
  433. /// 查询数据列表、返回 DataTable
  434. /// </summary>
  435. /// <param name="WhereSql">条件</param>
  436. /// <param name="Pagination">分页参数</param>
  437. /// <returns></returns>
  438. DataTable FindTablePage(string WhereSql, ref Pagination Pagination);
  439. /// <summary>
  440. /// 查询数据列表、返回 DataTable
  441. /// </summary>
  442. /// <param name="WhereSql">条件</param>
  443. /// <param name="parameters">sql语句对应参数</param>
  444. /// <param name="Pagination">分页参数</param>
  445. /// <returns></returns>
  446. DataTable FindTablePage(string WhereSql, DbParameter[] parameters, ref Pagination Pagination);
  447. /// <summary>
  448. /// 查询数据列表、返回 DataTable
  449. /// </summary>
  450. /// <param name="strSql">Sql语句</param>
  451. /// <param name="Pagination">分页参数</param>
  452. /// <returns></returns>
  453. DataTable FindTablePageBySql(string strSql, ref Pagination Pagination);
  454. /// <summary>
  455. /// 查询数据列表、返回 DataTable
  456. /// </summary>
  457. /// <param name="strSql">Sql语句</param>
  458. /// <param name="parameters">sql语句对应参数</param>
  459. /// <param name="Pagination">分页参数</param>
  460. /// <returns></returns>
  461. DataTable FindTablePageBySql(string strSql, DbParameter[] parameters, ref Pagination Pagination);
  462. /// <summary>
  463. /// 查询ERP数据列表、返回 DataTable
  464. /// </summary>
  465. /// <param name="strSql">Sql语句</param>
  466. /// <param name="parameters">sql语句对应参数</param>
  467. /// <param name="Pagination">分页参数</param>
  468. /// <returns></returns>
  469. DataTable FindTablePageBySql_ERP(string strSql, DbParameter[] parameters, ref Pagination Pagination );
  470. /// <summary>
  471. /// 查询ERP数据列表、返回 DataTable
  472. /// </summary>
  473. /// <param name="strSql">Sql语句</param>
  474. /// <param name="parameters">sql语句对应参数</param>
  475. /// <returns></returns>
  476. DataTable GetDataTableBySql_ERP(string strSql, params SqlParameter[] spArr);
  477. /// <summary>
  478. /// 查询ERP数据列表、返回 DataTable
  479. /// </summary>
  480. /// <param name="strSql">Sql语句</param>
  481. /// <param name="parameters">sql语句对应参数</param>
  482. /// <param name="Pagination">分页参数</param>
  483. /// <returns></returns>
  484. DataTable FindTablePageBySql_Other(string strSql, string connectstr, DbParameter[] parameters, ref Pagination Pagination);
  485. /// <summary>
  486. /// 查询ERP数据列表、返回 DataTable
  487. /// </summary>
  488. /// <param name="strSql">Sql语句</param>
  489. /// <param name="TempName">Temp表名</param>
  490. /// <param name="parameters">sql语句对应参数</param>
  491. /// <param name="Pagination">分页参数</param>
  492. /// <returns></returns>
  493. DataTable FindTablePageBySql_OtherTemp(string strSql, string TempName, string Droptable, string connectstr, DbParameter[] parameters, ref Pagination Pagination);
  494. /// <summary>
  495. /// 查询ERP数据列表、返回 DataTable
  496. /// </summary>
  497. /// <param name="strSql">Sql语句</param>
  498. /// <param name="parameters">sql语句对应参数</param>
  499. /// <returns></returns>
  500. DataTable GetDataTableBySql_Other(string strSql, string connectstr, params SqlParameter[] spArr);
  501. /// <summary>
  502. /// 查询数据列表、返回 DataTable
  503. /// </summary>
  504. /// <param name="procName">存储过程</param>
  505. /// <returns></returns>
  506. DataTable FindTableByProc(string procName);
  507. /// <summary>
  508. /// 查询数据列表、返回 DataTable
  509. /// </summary>
  510. /// <param name="procName">存储过程</param>
  511. /// <param name="parameters">sql语句对应参数</param>
  512. /// <returns></returns>
  513. DataTable FindTableByProc(string procName, DbParameter[] parameters);
  514. #endregion
  515. #region 查询数据列表、返回DataSet
  516. /// <summary>
  517. /// 查询数据列表、返回DataSet
  518. /// </summary>
  519. /// <param name="strSql">Sql语句</param>
  520. /// <returns></returns>
  521. DataSet FindDataSetBySql(string strSql);
  522. /// <summary>
  523. /// 查询数据列表、返回DataSet
  524. /// </summary>
  525. /// <param name="strSql">Sql语句</param>
  526. /// <param name="parameters">sql语句对应参数</param>
  527. /// <returns></returns>
  528. DataSet FindDataSetBySql(string strSql, DbParameter[] parameters);
  529. /// <summary>
  530. /// 查询数据列表、返回DataSet
  531. /// </summary>
  532. /// <param name="strSql">存储过程</param>
  533. /// <returns></returns>
  534. DataSet FindDataSetByProc(string procName);
  535. /// <summary>
  536. /// 查询数据列表、返回DataSet
  537. /// </summary>
  538. /// <param name="strSql">存储过程</param>
  539. /// <param name="parameters">sql语句对应参数</param>
  540. /// <returns></returns>
  541. DataSet FindDataSetByProc(string procName, DbParameter[] parameters);
  542. #endregion
  543. #region 查询对象、返回实体
  544. /// <summary>
  545. /// 查询对象、返回实体
  546. /// </summary>
  547. /// <param name="propertyValue">主键值</param>
  548. /// <returns></returns>
  549. T FindEntity(object propertyValue);
  550. /// <summary>
  551. /// 查询对象、返回实体
  552. /// </summary>
  553. /// <param name="propertyName">实体属性名称</param>
  554. /// <param name="propertyValue">字段值</param>
  555. /// <returns></returns>
  556. T FindEntity(string propertyName, object propertyValue);
  557. /// <summary>
  558. /// 查询对象、返回实体
  559. /// </summary>
  560. /// <param name="WhereSql">条件</param>
  561. /// <returns></returns>
  562. T FindEntityByWhere(string WhereSql);
  563. /// <summary>
  564. /// 查询对象、返回实体
  565. /// </summary>
  566. /// <param name="WhereSql">条件</param>
  567. /// <param name="parameters">sql语句对应参数</param>
  568. /// <returns></returns>
  569. T FindEntityByWhere(string WhereSql, DbParameter[] parameters);
  570. /// <summary>
  571. /// 查询对象、返回实体
  572. /// </summary>
  573. /// <param name="strSql">Sql语句</param>
  574. /// <returns></returns>
  575. T FindEntityBySql(string strSql);
  576. /// <summary>
  577. /// 查询对象、返回实体
  578. /// </summary>
  579. /// <param name="strSql">Sql语句</param>
  580. /// <param name="parameters">sql语句对应参数</param>
  581. /// <returns></returns>
  582. T FindEntityBySql(string strSql, DbParameter[] parameters);
  583. #endregion
  584. #region 查询数据、返回条数
  585. /// <summary>
  586. /// 查询数据、返回条数
  587. /// </summary>
  588. /// <returns></returns>
  589. int FindCount();
  590. /// <summary>
  591. /// 查询数据、返回条数
  592. /// <param name="propertyName">实体属性名称</param>
  593. /// <param name="propertyValue">字段值</param>
  594. /// </summary>
  595. /// <returns></returns>
  596. int FindCount(string propertyName, string propertyValue);
  597. /// <summary>
  598. /// 查询数据、返回条数
  599. /// </summary>
  600. /// <param name="WhereSql">条件</param>
  601. /// <returns></returns>
  602. int FindCount(string WhereSql);
  603. /// <summary>
  604. /// 查询数据、返回条数
  605. /// </summary>
  606. /// <param name="WhereSql">条件</param>
  607. /// <param name="parameters">sql语句对应参数</param>
  608. /// <returns></returns>
  609. int FindCount(string WhereSql, DbParameter[] parameters);
  610. /// <summary>
  611. /// 查询数据、返回条数
  612. /// </summary>
  613. /// <param name="strSql">Sql语句</param>
  614. /// <returns></returns>
  615. int FindCountBySql(string strSql);
  616. /// <summary>
  617. /// 查询数据、返回条数
  618. /// </summary>
  619. /// <param name="strSql">Sql语句</param>
  620. /// <param name="parameters">sql语句对应参数</param>
  621. /// <returns></returns>
  622. int FindCountBySql(string strSql, DbParameter[] parameters);
  623. #endregion
  624. #region 查询数据、返回最大数
  625. /// <summary>
  626. /// 查询数据、返回最大数
  627. /// </summary>
  628. /// <param name="propertyName">实体属性名称</param>
  629. /// <returns></returns>
  630. object FindMax(string propertyName);
  631. /// <summary>
  632. /// 查询数据、返回最大数
  633. /// </summary>
  634. /// <param name="propertyName">实体属性名称</param>
  635. /// <param name="WhereSql">条件</param>
  636. /// <returns></returns>
  637. object FindMax(string propertyName, string WhereSql);
  638. /// <summary>
  639. /// 查询数据、返回最大数
  640. /// </summary>
  641. /// <param name="propertyName">实体属性名称</param>
  642. /// <param name="WhereSql">条件</param>
  643. /// <param name="parameters">sql语句对应参数</param>
  644. /// <returns></returns>
  645. object FindMax(string propertyName, string WhereSql, DbParameter[] parameters);
  646. /// <summary>
  647. /// 查询数据、返回最大数
  648. /// </summary>
  649. /// <param name="strSql">Sql语句</param>
  650. /// <returns></returns>
  651. object FindMaxBySql(string strSql);
  652. /// <summary>
  653. /// 查询数据、返回最大数
  654. /// </summary>
  655. /// <param name="strSql">Sql语句</param>
  656. /// <param name="parameters">sql语句对应参数</param>
  657. /// <returns></returns>
  658. object FindMaxBySql(string strSql, DbParameter[] parameters);
  659. #endregion
  660. }
  661. }