条件查询,前端分页
This commit is contained in:
1 parent
75c580115c
commit
720cf26a59
10 files changed
+648
-81
No files matched your search
@@ -33,9 +33,36 @@ public class XWMSMFMController : BaseController
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Search()
|
||||
public ActionResult Search(string address, string zjcode, string materialcode, string gdbill, int gdline = 0, int ms = 0)
|
||||
{
|
||||
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSMFM where rownum <=30").Tables[0];
|
||||
var sql = @"select * from QREQ3.XWMSMFM where 1=1";
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
sql += $" and MFGFCY_0 = '{address}'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(zjcode))
|
||||
{
|
||||
sql += $" and MFIITMREF_0 like '%{zjcode}%'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(materialcode))
|
||||
{
|
||||
sql += $"and ITMREF_0 like '%{materialcode}%'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(gdbill))
|
||||
{
|
||||
sql += $" and MFGNUM_0 like '%{gdbill}%'";
|
||||
}
|
||||
if (gdline != 0)
|
||||
{
|
||||
sql += $" and MFGLIN_0 = '{gdline}'";
|
||||
}
|
||||
if (ms != 0)
|
||||
{
|
||||
sql += $" and STOCOD_0 = '{ms}'";
|
||||
}
|
||||
|
||||
var data = OracleHelper.GetDataSet(sql).Tables[0];
|
||||
|
||||
var list = data.AsEnumerable().Select
|
||||
(x => new
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user