2026821
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using GThinking.N_MODEL.Page;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
using GThinking.N_MISPRO;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
[EntityType(Db = "DBERP", Table = "XLXLB", IsWf = false, IsWhr = false, IsAttach = false)]
|
||||
|
||||
public class CLYL_DR : EntityObject
|
||||
{
|
||||
public string sPIID = "";
|
||||
public string sWLID = "";
|
||||
public string sWLMC = "";
|
||||
public string sGGXH = "";
|
||||
public string sTH = "";
|
||||
public string sCZ = "";
|
||||
|
||||
public string sXLXHID = "";
|
||||
public string sXLGGID = "";
|
||||
public string sXLBZID = "";
|
||||
public string sDYDJID = "";
|
||||
|
||||
public override TSQL SetQuerySql()
|
||||
{
|
||||
TSQL SQL = base.SetQuerySql();
|
||||
SQL.Add("select case when isnull(XSBJXHTH_BJXLXHID,' ') = ' ' then XLXLB_XLXHID else XSBJXHTH_BJXLXHID end as XLXLB_XLXHID,XLXLB_XLGGID,XLXLB_XLBZID,XLXLB_DYDJID,min(XLXLB_WLID) as XLXLB_WLID,WL_MC, ");
|
||||
SQL.Add(" case when isnull(WL_PIID,' ')=' ' then ' ' else rtrim(WL_PIID)||'|'||PL_MC end as WLLB, ");
|
||||
SQL.Add(" case when isnull(XLXLB_XLBZID,' ')=' ' then ' ' else rtrim(XLXLB_XLBZID)||'|'||XLBZ_XLBZLXMC end as XLBZ ");
|
||||
SQL.Add(" from XLXLB ");
|
||||
SQL.Add(" left join XSBJXHTH on XSBJXHTH_XLXHID=XLXLB_XLXHID ");
|
||||
SQL.Add(" left join WL on WL_WLID=XLXLB_WLID ");
|
||||
SQL.Add(" left join PL on PL_PIID=WL_PIID ");
|
||||
SQL.Add(" left join XLBZ on XLBZ_XLBZID=XLXLB_XLBZID ");
|
||||
SQL.Add(" where 1=1 ");
|
||||
SQL.Add(" and not exists(select 1 from XLXSCLQD where XLXSCLQD_XLXHID=case when isnull(XSBJXHTH_BJXLXHID,' ') = ' ' then XLXLB_XLXHID else XSBJXHTH_BJXLXHID end and XLXSCLQD_XLGGID=XLXLB_XLGGID and XLXSCLQD_XLBZID=XLXLB_XLBZID and XLXSCLQD_DYDJID=isnull(XLXLB_DYDJID,' '))");
|
||||
|
||||
if (!sPIID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and " + CMISproDataBase.GetWhereLead("WL_PIID", sPIID));
|
||||
}
|
||||
else
|
||||
SQL.Add(" and 1<>1 ");
|
||||
if (!sWLID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXLB_WLID like :pWLID ");
|
||||
SQL.ParamByName("pWLID").Value = "%" + sWLID + "%";
|
||||
}
|
||||
if (!sWLMC.Equals(""))
|
||||
{
|
||||
SQL.Add(" and WL_MC like :pWLMC ");
|
||||
SQL.ParamByName("pWLMC").Value = "%" + sWLMC + "%";
|
||||
}
|
||||
if (!sGGXH.Equals(""))
|
||||
{
|
||||
SQL.Add(" and WL_GG like :pGGXH ");
|
||||
SQL.ParamByName("pGGXH").Value = "%" + sGGXH + "%";
|
||||
}
|
||||
if (!sTH.Equals(""))
|
||||
{
|
||||
SQL.Add(" and WL_TZ like :pTH ");
|
||||
SQL.ParamByName("pTH").Value = "%" + sTH + "%";
|
||||
}
|
||||
if (!sCZ.Equals(""))
|
||||
{
|
||||
SQL.Add(" and WL_CL like :pCZ ");
|
||||
SQL.ParamByName("pCZ").Value = "%" + sCZ + "%";
|
||||
}
|
||||
if (!sXLXHID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and case when isnull(XSBJXHTH_BJXLXHID,' ') = ' ' then XLXLB_XLXHID else XSBJXHTH_BJXLXHID end = :pXLXHID ");
|
||||
SQL.ParamByName("pXLXHID").Value = sXLXHID;
|
||||
}
|
||||
if (!sXLGGID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXLB_XLGGID like :pXLGGID ");
|
||||
SQL.ParamByName("pXLGGID").Value = "%" + sXLGGID + "%";
|
||||
}
|
||||
if (!sXLBZID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXLB_XLBZID = :pXLBZID ");
|
||||
SQL.ParamByName("pXLBZID").Value = sXLBZID;
|
||||
}
|
||||
if (!sDYDJID.Equals(""))
|
||||
{
|
||||
SQL.Add(" and XLXLB_DYDJID = :pDYDJID ");
|
||||
SQL.ParamByName("pDYDJID").Value = sDYDJID;
|
||||
}
|
||||
SQL.Add(" group by XLXLB_XLXHID,XLXLB_XLGGID,XLXLB_XLBZID,XLXLB_DYDJID,WL_MC,WL_PIID,PL_MC,XLBZ_XLBZLXMC ");
|
||||
SQL.Add(" order by XLXLB_WLID ");
|
||||
return SQL;
|
||||
}
|
||||
|
||||
public override bool Querying(TSQL sql)
|
||||
{
|
||||
Entites.Columns.Clear();
|
||||
Entites.Clear();
|
||||
return base.Querying(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user