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.

32 lines
1.3 KiB

  1. namespace CounsellorBL.PRD.ConstDefinition
  2. {
  3. using OT.COM.ArsenalDB;
  4. using OT.COM.ArsenalDB.SQL;
  5. using SoldierData.EnterprizeV4;
  6. internal class PrdSQLLib : DirectSQLLibBase
  7. {
  8. public PrdSQLLib(ADirectSQLHelper i_sqlLibBase) : base(i_sqlLibBase) { }
  9. public virtual string GetArticleProduct(string i_sArticleUid, out Command o_cResult)
  10. {
  11. ADirectCmdParameter cp = GetParamter();
  12. string sSQL = $@"SELECT a.{tb_prd_product.CN_UID}
  13. , a.{tb_prd_product.CN_NAME}
  14. , a.{tb_prd_product.CN_MEMO}
  15. , b.{tb_prd_article2product.CN_WHOLESALE_PRICE}
  16. , b.{tb_prd_article2product.CN_PRICE}
  17. , b.{tb_prd_article2product.CN_SEQ}
  18. , b.{tb_prd_article2product.CN_SPECIFICATION}
  19. FROM {GetFormalTableName<tb_prd_product>()} a
  20. LEFT JOIN {GetFormalTableName<tb_prd_article2product>()} b
  21. on a.{tb_prd_product.CN_UID} = b.{tb_prd_article2product.CN_PRD_UID}
  22. where b.{tb_prd_article2product.CN_ARTICLE_UID} = {cp.Add(i_sArticleUid)}
  23. order by b.{tb_prd_article2product.CN_SEQ}";
  24. return GenerateCommand<tb_prd_product>(sSQL, cp, out o_cResult);
  25. }
  26. }
  27. }