SlmBaseCustomerDAL.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using CoreFS.CA06;
  7. using DbHelp = Core.StlMes.Client.Sale.DbHelp;
  8. namespace Core.StlMes.Client.Sale.SaleFundMgt.FundDAL.InterfaceInfoDAL
  9. {
  10. public class SlmBaseCustomerDAL : BaseDAL.BaseDAL
  11. {
  12. public SlmBaseCustomerDAL(OpeBase ob)
  13. : base(ob)
  14. {
  15. }
  16. public DataSet GetBaseCustomberInfo(string sqlCondition)
  17. {
  18. string sql = @"select a.customer_no,
  19. a.customer_nm,
  20. a.bigarea,
  21. c.basename,
  22. a.region_no,
  23. d.region_nm,
  24. a.user_grp,
  25. a.org,
  26. a.py,
  27. a.validflag,
  28. a.create_time,
  29. a.create_name,
  30. b.sale_org,
  31. b.custm_use,
  32. a.ABRVITION
  33. from slm_base_customer a
  34. left join slm_base_custm_use b on a.customer_no = b.customer_no
  35. and b.validflag = '1'
  36. left join Com_Base_Info c on a.bigarea = c.basecode
  37. left join SEL_ADMIN_REGION d on a.region_no = d.region_no
  38. where a.validflag = '1' {0}
  39. ";
  40. sql = string.Format(sql, sqlCondition);
  41. return base.ExecuteReaderForSaleFund(sql);
  42. }
  43. public DataSet GetJsBaseCustomberInfo()
  44. {
  45. string sql = @"select a.customer_no,a.customer_nm,a.bigarea,a.py,a.create_name,a.create_time,abrvition
  46. from slm_base_customer a
  47. where a.validflag = '1'
  48. and exists (select 1
  49. from Slm_Base_Custm_Use b
  50. where a.customer_no = b.customer_no
  51. and b.custm_use = '100202') ";
  52. return base.ExecuteReaderForSaleFund(sql);
  53. }
  54. public DataSet GetBaseCustomberInfoBySaleOrg(string saleOrg)
  55. {
  56. string sqlConditon = string.Format(" and b.sale_org = '{0}' ", saleOrg);
  57. return GetBaseCustomberInfo(sqlConditon);
  58. }
  59. public DataSet GetBaseCustomberInfoBySaleOrgAndCustUse(string saleOrg, string custUse)
  60. {
  61. string sqlConditon = string.Format(" and b.sale_org = '{0}' and b.custm_use = '{1}' ", saleOrg, custUse);
  62. return GetBaseCustomberInfo(sqlConditon);
  63. }
  64. public DataSet GetBaseCustomerInfo()
  65. {
  66. string sql = "SELECT A.CUSTOMER_NO,A.CUSTOMER_NM FROM SLM_BASE_CUSTOMER A ";
  67. return base.ExecuteReaderForSaleFund(sql);
  68. }
  69. }
  70. }