From 4588ff56df8dde33b9fbe6193c1b58aeb71506f6 Mon Sep 17 00:00:00 2001
From: ky_yusj <2655568377@qq.com>
Date: Mon, 5 Jul 2021 17:50:21 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix=20HouseCode=E6=9F=A5=E8=AF=A2=E6=9D=A1?=
=?UTF-8?q?=E4=BB=B6=E5=AE=8C=E5=96=84=20update=20=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=96=B0=E5=A2=9Estartwith=E5=92=8Cendwith?=
=?UTF-8?q?=E7=9A=84like=E6=9F=A5=E8=AF=A2=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../HouseSafety/HouseCode/HouseCodeService.cs | 2 +-
Api/Ewide.Core/Enum/QueryTypeEnum.cs | 14 ++++++++++-
Api/Ewide.Core/Ewide.Core.xml | 10 ++++++++
.../Extension/DataFilter/Entity/SearchInfo.cs | 4 ++-
.../WebPage/SearchJsonFitlerInfoGetService.cs | 8 +++---
.../src/pages/business/house/code/index.jsx | 25 +++++++++++--------
web-react/src/util/query/index.js | 4 ++-
7 files changed, 49 insertions(+), 18 deletions(-)
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
index e57b2b2..ff662e9 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
@@ -70,7 +70,7 @@ LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) ";
- return await _dapperRepository.QueryPageDataDynamic(sql, input, filterFields: new string[] {"Type", "Address", "HouseCode" });
+ return await _dapperRepository.QueryPageDataDynamic(sql, input, filterFields: new string[] {"Type", "Address", "HouseCode","AreaCode"});
}
[HttpGet("/houseCode/detail")]
diff --git a/Api/Ewide.Core/Enum/QueryTypeEnum.cs b/Api/Ewide.Core/Enum/QueryTypeEnum.cs
index 56b12b6..0ac53ca 100644
--- a/Api/Ewide.Core/Enum/QueryTypeEnum.cs
+++ b/Api/Ewide.Core/Enum/QueryTypeEnum.cs
@@ -53,6 +53,18 @@ namespace Ewide.Core
/// 不为空
///
[Description("不为空")]
- IsNotNull = 7
+ IsNotNull = 7,
+
+ ///
+ /// 开始于 LIKE Param%
+ ///
+ [Description("LIKE Param%")]
+ StartWith =8,
+
+ ///
+ /// 结合于 LIKE %Param
+ ///
+ [Description("LIKE %Param")]
+ EndWith = 9
}
}
diff --git a/Api/Ewide.Core/Ewide.Core.xml b/Api/Ewide.Core/Ewide.Core.xml
index 8cc30b3..d504a79 100644
--- a/Api/Ewide.Core/Ewide.Core.xml
+++ b/Api/Ewide.Core/Ewide.Core.xml
@@ -2522,6 +2522,16 @@
不为空
+
+
+ 开始于 LIKE Param%
+
+
+
+
+ 结合于 LIKE %Param
+
+
菜单激活类型
diff --git a/Api/Ewide.Core/Extension/DataFilter/Entity/SearchInfo.cs b/Api/Ewide.Core/Extension/DataFilter/Entity/SearchInfo.cs
index bed6461..e62da60 100644
--- a/Api/Ewide.Core/Extension/DataFilter/Entity/SearchInfo.cs
+++ b/Api/Ewide.Core/Extension/DataFilter/Entity/SearchInfo.cs
@@ -29,13 +29,15 @@ namespace Ewide.Core
{
get
{
- return Type switch
+ return Type.ToLower() switch
{
"=" or "equal" => QueryTypeEnum.Equal,
"<" or "lessthan" => QueryTypeEnum.LessThan,
"<=" or "lessthanorequal" => QueryTypeEnum.LessThanOrEqual,
">" or "greaterthan" => QueryTypeEnum.GreaterThan,
">=" or "greaterthanorequal" => QueryTypeEnum.GreaterThanOrEqual,
+ "start" => QueryTypeEnum.StartWith,
+ "end" => QueryTypeEnum.EndWith,
_ => QueryTypeEnum.Like,
};
}
diff --git a/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs b/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
index 8daaf05..1e78bce 100644
--- a/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
+++ b/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
@@ -64,7 +64,7 @@ namespace Ewide.Core.Extension.DataFilter.WebPage
var parameterName = "@" + searchInfo.Field + Guid.NewGuid().ToString("N");
//AddParameter(parameterName, elem);
- sqlParameters.Add(parameterName, QueryTypeEnum.Like == searchInfo.QueryType ? "%" + elem + "%" : elem);
+ sqlParameters.Add(parameterName, QueryTypeEnum.Like == searchInfo.QueryType ? "%" + elem + "%" : QueryTypeEnum.StartWith == searchInfo.QueryType ? elem + "%" : QueryTypeEnum.EndWith == searchInfo.QueryType ? "%" + elem : elem);
whereList.Add(String.Format(sqlT, searchInfo.Field, GetSearchOperatorStr(searchInfo.QueryType), parameterName));
}
if (whereList.Count == 0) return String.Empty;
@@ -85,10 +85,10 @@ namespace Ewide.Core.Extension.DataFilter.WebPage
return "<";
case QueryTypeEnum.LessThanOrEqual:
return "<=";
- case QueryTypeEnum.Like:
- return " LIKE ";
- default:
+ case QueryTypeEnum.Equal:
return "=";
+ default:
+ return "LIKE";
}
}
diff --git a/web-react/src/pages/business/house/code/index.jsx b/web-react/src/pages/business/house/code/index.jsx
index 612ad7f..267e342 100644
--- a/web-react/src/pages/business/house/code/index.jsx
+++ b/web-react/src/pages/business/house/code/index.jsx
@@ -5,7 +5,7 @@ import {
Cascader,
Form,
Input,
- InputNumber,
+ Tag,
Popconfirm,
message as Message,
Radio,
@@ -51,10 +51,15 @@ export default class index extends Component {
dataIndex: 'houseCode',
sorter: true,
width: 300,
- render: (text, record) =>
- `${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${record.no
- .toString()
- .padStart(3, '0')}`,
+ render: (text, record) => (
+ <>
+ {`${record.areaName}-${record.roadName}-${record.commName}-${
+ record.note
+ }-${record.no.toString().padStart(3, '0')}`}
+
+ {text}
+ >
+ ),
},
{
title: '房屋性质及行业',
@@ -288,7 +293,10 @@ export default class index extends Component {
placeholder="请选择所在区域"
/>
-
+
+
+
+ {/*
value && value.padStart(3, '0')}
max={999}
@@ -297,7 +305,7 @@ export default class index extends Component {
step={1}
placeholder="请输入房屋序号"
/>
-
+ */}
全部
@@ -326,9 +334,6 @@ export default class index extends Component {
-
-
-
}
operator={
diff --git a/web-react/src/util/query/index.js b/web-react/src/util/query/index.js
index 2aa58ae..cd5050c 100644
--- a/web-react/src/util/query/index.js
+++ b/web-react/src/util/query/index.js
@@ -103,5 +103,7 @@ export const QueryType = {
LessThan: '<',
LessThanOrEqual: '<=',
Like: 'LIKE',
- Equal: '='
+ Equal: '=',
+ StartWith: 'STRAT',
+ EndWith: 'END'
}
\ No newline at end of file
From f5bdc7e1ab02ee29bd8feabb2c02fca65da9bf39 Mon Sep 17 00:00:00 2001
From: ky_yusj <2655568377@qq.com>
Date: Tue, 6 Jul 2021 09:33:43 +0800
Subject: [PATCH 2/2] =?UTF-8?q?update=20=20dapper=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs b/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
index 1e78bce..0b338ad 100644
--- a/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
+++ b/Api/Ewide.Core/Extension/DataFilter/WebPage/SearchJsonFitlerInfoGetService.cs
@@ -56,7 +56,7 @@ namespace Ewide.Core.Extension.DataFilter.WebPage
#region 私有方法
private string GetWhereSqlBuild(SearchInfo searchInfo)
{
- string sqlT = "`{0}`{1}{2}";
+ string sqlT = "`{0}` {1} {2}";
List whereList = new List();
foreach (var elem in searchInfo.Value)
{