From ebf579204268179fec2ba4599f9f904a20c69bd3 Mon Sep 17 00:00:00 2001 From: qiankunpingtai Date: Tue, 14 May 2019 16:22:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AFsql$?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper_xml/DepotMapperEx.xml | 24 ++++--- .../mapper_xml/FunctionsMapperEx.xml | 14 ++-- .../mapper_xml/InOutItemMapperEx.xml | 24 ++++--- src/main/resources/mapper_xml/LogMapperEx.xml | 46 +++++++------ .../mapper_xml/MaterialCategoryMapperEx.xml | 14 ++-- .../resources/mapper_xml/MaterialMapperEx.xml | 40 ++++++----- .../mapper_xml/MaterialPropertyMapperEx.xml | 10 +-- .../resources/mapper_xml/PersonMapperEx.xml | 14 ++-- .../resources/mapper_xml/RoleMapperEx.xml | 10 +-- .../resources/mapper_xml/SupplierMapperEx.xml | 66 +++++++++++-------- .../mapper_xml/SystemConfigMapperEx.xml | 10 +-- .../resources/mapper_xml/UnitMapperEx.xml | 10 +-- .../resources/mapper_xml/UserMapperEx.xml | 22 ++++--- 13 files changed, 177 insertions(+), 127 deletions(-) diff --git a/src/main/resources/mapper_xml/DepotMapperEx.xml b/src/main/resources/mapper_xml/DepotMapperEx.xml index 5ce8de63..4bc96147 100644 --- a/src/main/resources/mapper_xml/DepotMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotMapperEx.xml @@ -9,14 +9,16 @@ select * FROM jsh_depot where 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type=${type} + and type=#{type} - - and remark like '%${remark}%' + + + and remark like #{remark} and ifnull(delete_Flag,'0') !='1' order by sort asc @@ -29,14 +31,16 @@ COUNT(id) FROM jsh_depot WHERE 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type=${type} + and type=#{type} - - and remark like '%${remark}%' + + + and remark like #{remark} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/FunctionsMapperEx.xml b/src/main/resources/mapper_xml/FunctionsMapperEx.xml index e3ed78f1..dd09003b 100644 --- a/src/main/resources/mapper_xml/FunctionsMapperEx.xml +++ b/src/main/resources/mapper_xml/FunctionsMapperEx.xml @@ -5,11 +5,12 @@ select * FROM jsh_functions where 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} and ifnull(delete_Flag,'0') !='1' order by sort asc @@ -22,11 +23,12 @@ COUNT(id) FROM jsh_functions WHERE 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/InOutItemMapperEx.xml b/src/main/resources/mapper_xml/InOutItemMapperEx.xml index c3dc04a4..b26365aa 100644 --- a/src/main/resources/mapper_xml/InOutItemMapperEx.xml +++ b/src/main/resources/mapper_xml/InOutItemMapperEx.xml @@ -5,14 +5,16 @@ select * FROM jsh_inoutitem where 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} - - and remark like '%${remark}%' + + + and remark like #{remark} and ifnull(delete_Flag,'0') !='1' @@ -24,14 +26,16 @@ COUNT(id) FROM jsh_inoutitem WHERE 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} - - and remark like '%${remark}%' + + + and remark like #{remark} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/LogMapperEx.xml b/src/main/resources/mapper_xml/LogMapperEx.xml index afb489f1..fcc6919e 100644 --- a/src/main/resources/mapper_xml/LogMapperEx.xml +++ b/src/main/resources/mapper_xml/LogMapperEx.xml @@ -10,26 +10,29 @@ FROM jsh_log l left join jsh_user u on l.userID = u.id and ifnull(u.status,'0') not in('1','2') where 1=1 - - and l.operation like '%${operation}%' + + + and l.operation like #{operation} - and l.userID=${usernameID} + and l.userID=#{usernameID} - - and l.clientIp like '%${clientIp}%' + + + and l.clientIp like #{clientIp} - and l.status=${status} + and l.status=#{status} - and l.createtime >= '%${beginTime}%' + and l.createtime >= #{beginTime} - and l.createtime <= '%${endTime}%' + and l.createtime <= #{endTime} - - and l.contentdetails like '%${contentdetails}%' + + + and l.contentdetails like #{contentdetails} order by l.createtime desc @@ -41,26 +44,29 @@ COUNT(id) FROM jsh_log WHERE 1=1 - - and operation like '%${operation}%' + + + and operation like #{operation} - and userID=${usernameID} + and userID=#{usernameID} - - and clientIp like '%${clientIp}%' + + + and clientIp like #{clientIp} - and status = ${status} + and status = #{status} = '${beginTime}' + and createtime >= #{beginTime} ]]> - - and contentdetails like '%${contentdetails}%' + + + and contentdetails like #{contentdetails} \ No newline at end of file diff --git a/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml b/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml index b2563ed8..6f65a949 100644 --- a/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml +++ b/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml @@ -6,11 +6,12 @@ FROM jsh_materialcategory where 1=1 and ifnull(status,'0') !='2' - - and name like '%${name}%' + + + and name like #{name} - and parentId = ${parentId} + and parentId = #{parentId} and Id !=1 @@ -23,11 +24,12 @@ FROM jsh_materialcategory WHERE 1=1 and ifnull(status,'0') !='2' - - and name like '%${name}%' + + + and name like #{name} - and parentId = ${parentId} + and parentId = #{parentId} and Id !=1 diff --git a/src/main/resources/mapper_xml/MaterialMapperEx.xml b/src/main/resources/mapper_xml/MaterialMapperEx.xml index fe000c24..cd008d63 100644 --- a/src/main/resources/mapper_xml/MaterialMapperEx.xml +++ b/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -16,14 +16,16 @@ left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' where 1=1 - - and m.name like '%${name}%' + + + and m.name like #{name} - - and m.model like '%${model}%' + + + and m.model like #{model} - and m.CategoryId in (${categoryIds}) + and m.CategoryId in (#{categoryIds}) and ifnull(m.delete_Flag,'0') !='1' order by m.id asc @@ -39,14 +41,16 @@ left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' WHERE 1=1 - - and m.name like '%${name}%' + + + and m.name like #{name} - - and m.model like '%${model}%' + + + and m.model like #{model} - and m.CategoryId in (${categoryIds}) + and m.CategoryId in (#{categoryIds}) and ifnull(m.delete_Flag,'0') !='1' @@ -54,14 +58,14 @@ @@ -96,14 +100,16 @@ left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1' left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2' where 1=1 - - and m.name like '%${name}%' + + + and m.name like #{name} - - and m.model like '%${model}%' + + + and m.model like #{model} - and m.CategoryId in (${categoryIds}) + and m.CategoryId in (#{categoryIds}) and ifnull(m.delete_Flag,'0') !='1' order by m.id asc diff --git a/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml b/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml index eb5f8a81..7046175e 100644 --- a/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml +++ b/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml @@ -5,8 +5,9 @@ select * FROM jsh_materialproperty where 1=1 - - and nativeName like '%${name}%' + + + and nativeName like #{nativeName} and ifnull(delete_Flag,'0') !='1' @@ -18,8 +19,9 @@ COUNT(id) FROM jsh_materialproperty WHERE 1=1 - - and nativeName like '%${name}%' + + + and nativeName like #{nativeName} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/PersonMapperEx.xml b/src/main/resources/mapper_xml/PersonMapperEx.xml index 39d8b013..5795c3f5 100644 --- a/src/main/resources/mapper_xml/PersonMapperEx.xml +++ b/src/main/resources/mapper_xml/PersonMapperEx.xml @@ -5,11 +5,12 @@ select * FROM jsh_person where 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} and ifnull(delete_Flag,'0') !='1' @@ -21,11 +22,12 @@ COUNT(id) FROM jsh_person WHERE 1=1 - - and name like '%${name}%' + + + and name like #{name} - and type='${type}' + and type=#{type} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/RoleMapperEx.xml b/src/main/resources/mapper_xml/RoleMapperEx.xml index b7485492..fe0900ec 100644 --- a/src/main/resources/mapper_xml/RoleMapperEx.xml +++ b/src/main/resources/mapper_xml/RoleMapperEx.xml @@ -6,8 +6,9 @@ FROM jsh_role WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - - and name like '%${name}%' + + + and name like #{name} limit #{offset},#{rows} @@ -19,8 +20,9 @@ FROM jsh_role WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - - and name like '%${name}%' + + + and name like #{name} diff --git a/src/main/resources/mapper_xml/SupplierMapperEx.xml b/src/main/resources/mapper_xml/SupplierMapperEx.xml index 868df611..fb7a3629 100644 --- a/src/main/resources/mapper_xml/SupplierMapperEx.xml +++ b/src/main/resources/mapper_xml/SupplierMapperEx.xml @@ -5,20 +5,24 @@ select * FROM jsh_supplier where 1=1 - - and supplier like '%${supplier}%' + + + and supplier like #{supplier} - and type='${type}' + and type=#{type} - - and phonenum like '%${phonenum}%' + + + and phonenum like #{phonenum} - - and telephone like '%${telephone}%' + + + and telephone like #{telephone} - - and description like '%${description}%' + + + and description like #{description} and ifnull(delete_Flag,'0') !='1' @@ -30,20 +34,24 @@ COUNT(id) FROM jsh_supplier WHERE 1=1 - - and supplier like '%${supplier}%' + + + and supplier like #{supplier} - and type='${type}' + and type=#{type} - - and phonenum like '%${phonenum}%' + + + and phonenum like #{phonenum} - - and telephone like '%${telephone}%' + + + and telephone like #{telephone} - - and description like '%${description}%' + + + and description like #{description} and ifnull(delete_Flag,'0') !='1' @@ -52,20 +60,24 @@ select * FROM jsh_supplier where 1=1 - - and supplier like '%${supplier}%' + + + and supplier like #{supplier} - and type='${type}' + and type=#{type} - - and phonenum like '%${phonenum}%' + + + and phonenum like #{phonenum} - - and telephone like '%${telephone}%' + + + and telephone like #{telephone} - - and description like '%${description}%' + + + and description like #{description} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/SystemConfigMapperEx.xml b/src/main/resources/mapper_xml/SystemConfigMapperEx.xml index b0867a48..7572728c 100644 --- a/src/main/resources/mapper_xml/SystemConfigMapperEx.xml +++ b/src/main/resources/mapper_xml/SystemConfigMapperEx.xml @@ -5,8 +5,9 @@ select * FROM jsh_systemconfig where 1=1 - - and company_name like '%${companyName}%' + + + and company_name like #{companyName} and ifnull(delete_Flag,'0') !='1' @@ -18,8 +19,9 @@ COUNT(id) FROM jsh_systemconfig WHERE 1=1 - - and company_name like '%${companyName}%' + + + and company_name like #{companyName} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/UnitMapperEx.xml b/src/main/resources/mapper_xml/UnitMapperEx.xml index f02e0a86..bb324f38 100644 --- a/src/main/resources/mapper_xml/UnitMapperEx.xml +++ b/src/main/resources/mapper_xml/UnitMapperEx.xml @@ -5,8 +5,9 @@ select * FROM jsh_unit where 1=1 - - and UName like '%${name}%' + + + and UName like #{name} and ifnull(delete_Flag,'0') !='1' @@ -18,8 +19,9 @@ COUNT(id) FROM jsh_unit WHERE 1=1 - - and UName like '%${name}%' + + + and UName like #{name} and ifnull(delete_Flag,'0') !='1' diff --git a/src/main/resources/mapper_xml/UserMapperEx.xml b/src/main/resources/mapper_xml/UserMapperEx.xml index af16341a..7a0a274a 100644 --- a/src/main/resources/mapper_xml/UserMapperEx.xml +++ b/src/main/resources/mapper_xml/UserMapperEx.xml @@ -14,11 +14,13 @@ FROM jsh_user where 1=1 and ifnull(status,'0') not in('1','2') - - and username like '%${userName}%' + + + and username like #{userName} - - and loginame like '%${loginName}%' + + + and loginame like #{loginName} limit #{offset},#{rows} @@ -30,11 +32,13 @@ FROM jsh_user WHERE 1=1 and ifnull(status,'0') not in('1','2') - - and username like '%${userName}%' + + + and username like #{userName} - - and loginame like '%${loginName}%' + + + and loginame like #{loginName} - select registerUserTemplate(#{userId},#{tenantId},#{roleId}) from dual;