模糊查询修改
This commit is contained in:
parent
1c52322414
commit
63e3a8b307
|
@ -419,14 +419,14 @@ namespace Competition.Mysql.DAL
|
|||
T1 = string.Format("(select * FROM T_STK_STORAGE_SILO WHERE SILO_CODE LIKE '{0}')", req.SILO_CODE);
|
||||
}
|
||||
|
||||
if(string.IsNullOrEmpty(req.SHIP_NAME_EN) && string.IsNullOrEmpty(req.VOYAGE_NO) && string.IsNullOrEmpty(req.STANDARD_NAME))
|
||||
if(string.IsNullOrEmpty(req.SHIP_NAME_EN) && string.IsNullOrEmpty(req.VOYAGE_NO) && string.IsNullOrEmpty(req.STANDARD_NAME) && string.IsNullOrEmpty(req.MONITOR_ID))
|
||||
{
|
||||
T2 = "T_STK_STORAGE";
|
||||
}
|
||||
else
|
||||
{
|
||||
T2 = "(select * FROM T_STK_STORAGE WHERE ";
|
||||
string tmp1="",tmp2="",tmp3="";
|
||||
string tmp1="",tmp2="",tmp3="",tmp4="";
|
||||
if(!string.IsNullOrEmpty(req.SHIP_NAME_EN))
|
||||
{
|
||||
tmp1 = string.Format("SHIP_NAME_EN LIKE '{0}' AND ", req.SHIP_NAME_EN);
|
||||
|
@ -440,10 +440,16 @@ namespace Competition.Mysql.DAL
|
|||
if (!string.IsNullOrEmpty(req.STANDARD_NAME))
|
||||
{
|
||||
tmp3 = string.Format("STANDARD_NAME LIKE '{0}' AND ", req.STANDARD_NAME);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty (req.MONITOR_ID))
|
||||
{
|
||||
tmp4 = string.Format("MONITOR_ID = '{0}' AND ", req.MONITOR_ID);
|
||||
|
||||
}
|
||||
|
||||
//拼接
|
||||
T2 = T2 + tmp1 + tmp2 + tmp3;
|
||||
T2 = T2 + tmp1 + tmp2 + tmp3+tmp4;
|
||||
T2 = T2.TrimEnd(" AND ".ToCharArray());
|
||||
|
||||
//结尾
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using NPOI.HSSF.Record;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -11,6 +12,10 @@ namespace Competition.Mysql.Other
|
|||
/// </summary>
|
||||
public class ReqYardCheck
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业id
|
||||
/// </summary>
|
||||
public string MONITOR_ID;
|
||||
/// <summary>
|
||||
/// 船名
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue