From 99e7db36d3fe701adaa7945f5c50563c28a19006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 9 Jun 2021 20:29:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=92=8Csql=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/erp/constants/BusinessConstants.java | 8 ++ .../erp/controller/AccountHeadController.java | 3 +- .../erp/controller/DepotHeadController.java | 17 ++- .../erp/controller/DepotItemController.java | 14 +- .../erp/service/account/AccountService.java | 24 ++-- .../accountHead/AccountHeadService.java | 5 + .../service/depotHead/DepotHeadService.java | 5 + .../service/depotItem/DepotItemService.java | 8 +- .../main/java/com/jsh/erp/utils/Tools.java | 28 +++- .../mapper_xml/AccountHeadMapperEx.xml | 24 ++-- .../mapper_xml/AccountItemMapperEx.xml | 18 ++- .../resources/mapper_xml/AccountMapperEx.xml | 48 ++++--- .../mapper_xml/DepotHeadMapperEx.xml | 122 +++++++++--------- .../mapper_xml/DepotItemMapperEx.xml | 48 +++---- .../resources/mapper_xml/DepotMapperEx.xml | 16 ++- .../resources/mapper_xml/FunctionMapperEx.xml | 10 +- .../mapper_xml/InOutItemMapperEx.xml | 16 ++- .../main/resources/mapper_xml/LogMapperEx.xml | 34 +++-- .../mapper_xml/MaterialCategoryMapperEx.xml | 10 +- .../mapper_xml/MaterialExtendMapperEx.xml | 4 +- .../resources/mapper_xml/MaterialMapperEx.xml | 47 ++++--- .../mapper_xml/MaterialPropertyMapperEx.xml | 6 +- .../main/resources/mapper_xml/MsgMapperEx.xml | 10 +- .../resources/mapper_xml/PersonMapperEx.xml | 10 +- .../resources/mapper_xml/RoleMapperEx.xml | 6 +- .../resources/mapper_xml/SupplierMapperEx.xml | 33 +++-- .../mapper_xml/SystemConfigMapperEx.xml | 6 +- .../resources/mapper_xml/TenantMapperEx.xml | 6 +- .../resources/mapper_xml/UnitMapperEx.xml | 6 +- .../resources/mapper_xml/UserMapperEx.xml | 12 +- 30 files changed, 361 insertions(+), 243 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java index cb4a09ff..fb68641e 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java @@ -13,6 +13,14 @@ public class BusinessConstants { * 默认的日期格式 */ public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + /** + * 一天的初始时间 + */ + public static final String DAY_FIRST_TIME = " 00:00:00"; + /** + * 一天的结束时间 + */ + public static final String DAY_LAST_TIME = " 23:59:59"; /** * 默认的分页起始页页码 */ diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java index 6027f42e..5c2d97b1 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java @@ -1,6 +1,7 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONObject; +import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.AccountHeadVo4Body; import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; @@ -76,7 +77,7 @@ public class AccountHeadController { Map map = new HashMap(); try { JSONObject outer = new JSONObject(); - endTime = endTime + " 23:59:59"; + endTime = endTime + BusinessConstants.DAY_LAST_TIME; BigDecimal sum = accountHeadService.findTotalPay(supplierId, endTime, supType); outer.put("getAllMoney", sum); map.put("rows", outer); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java index 39377e85..aaa0be63 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java @@ -2,6 +2,7 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.DepotHead; import com.jsh.erp.datasource.entities.DepotHeadVo4Body; @@ -96,6 +97,8 @@ public class DepotHeadController { Map map = new HashMap(); try { List resList = new ArrayList(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); List list = depotHeadService.findByAll(beginTime, endTime, type, materialParam, depotId, oId, (currentPage-1)*pageSize, pageSize); int total = depotHeadService.findByAllCount(beginTime, endTime, type, materialParam, depotId, oId); map.put("total", total); @@ -143,8 +146,8 @@ public class DepotHeadController { Map map = new HashMap(); try { List resList = new ArrayList<>(); - beginTime = beginTime + " 00:00:00"; - endTime = endTime + " 23:59:59"; + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); List list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, materialParam, depotId, oId, (currentPage-1)*pageSize, pageSize); int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, depotId, oId); map.put("total", total); @@ -193,8 +196,8 @@ public class DepotHeadController { } else if (supType.equals("供应商")) { //供应商 j = -1; } - beginTime = beginTime + " 00:00:00"; - endTime = endTime + " 23:59:59"; + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); List resList = new ArrayList(); List list = depotHeadService.findStatementAccount(beginTime, endTime, organId, supType, (currentPage-1)*pageSize, pageSize); int total = depotHeadService.findStatementAccountCount(beginTime, endTime, organId, supType); @@ -277,7 +280,7 @@ public class DepotHeadController { Map map = new HashMap(); try { JSONObject outer = new JSONObject(); - endTime = endTime + " 23:59:59"; + endTime = endTime + BusinessConstants.DAY_LAST_TIME; BigDecimal sum = depotHeadService.findTotalPay(supplierId, endTime, supType); outer.put("getAllMoney", sum); map.put("rows", outer); @@ -369,8 +372,8 @@ public class DepotHeadController { BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); try { - String today = Tools.getNow() + " 00:00:00"; - String firstDay = Tools.getCurrentMonth() + "-01 00:00:00"; + String today = Tools.getNow() + BusinessConstants.DAY_FIRST_TIME; + String firstDay = Tools.firstDayOfMonth(Tools.getCurrentMonth()) + BusinessConstants.DAY_FIRST_TIME; BigDecimal todaySale = depotHeadService.getBuyAndSaleStatistics("出库", "销售", 1, today, getNow3()); //今日销售出库 BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售", diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java index de0946a5..65d44a69 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -265,8 +265,8 @@ public class DepotItemController { BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); Long tenantId = redisService.getTenantId(request); - String timeA = monthTime+"-01 00:00:00"; - String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; + String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; try { List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), timeB,(currentPage-1)*pageSize, pageSize); @@ -335,8 +335,8 @@ public class DepotItemController { @RequestParam("materialParam") String materialParam, HttpServletRequest request, HttpServletResponse response) throws Exception { Long tenantId = redisService.getTenantId(request); - String timeA = monthTime+"-01 00:00:00"; - String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; + String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; try { List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), timeB, null, null); @@ -385,7 +385,7 @@ public class DepotItemController { BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); Long tenantId = redisService.getTenantId(request); - String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; try { List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), endTime, null, null); @@ -431,7 +431,7 @@ public class DepotItemController { HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); - String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; try { List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), endTime, (currentPage-1)*pageSize, pageSize); @@ -493,7 +493,7 @@ public class DepotItemController { HttpServletRequest request)throws Exception { BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); - String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; try { List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), endTime,(currentPage-1)*pageSize, pageSize); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java index 30e23e22..22eadc20 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java @@ -272,9 +272,9 @@ public class AccountService { try { DepotHeadExample example = new DepotHeadExample(); if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); - Date eTime = StringUtil.getDateByString(timeStr + "-31 00:00:00", null); - Date mTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); if (type.equals("month")) { example.createCriteria().andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) @@ -317,9 +317,9 @@ public class AccountService { try { AccountHeadExample example = new AccountHeadExample(); if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); - Date eTime = StringUtil.getDateByString(timeStr + "-31 00:00:00", null); - Date mTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); if (type.equals("month")) { example.createCriteria().andAccountIdEqualTo(id) .andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) @@ -363,9 +363,9 @@ public class AccountService { try { AccountHeadExample example = new AccountHeadExample(); if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); - Date eTime = StringUtil.getDateByString(timeStr + "-31 00:00:00", null); - Date mTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); if (type.equals("month")) { example.createCriteria().andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); @@ -422,9 +422,9 @@ public class AccountService { try { DepotHeadExample example = new DepotHeadExample(); if (!timeStr.equals("")) { - Date bTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); - Date eTime = StringUtil.getDateByString(timeStr + "-31 00:00:00", null); - Date mTime = StringUtil.getDateByString(timeStr + "-01 00:00:00", null); + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); if (type.equals("month")) { example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java index d5e80e8c..89eeef60 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java @@ -15,6 +15,7 @@ import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.orgaUserRel.OrgaUserRelService; import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.StringUtil; +import com.jsh.erp.utils.Tools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -88,6 +89,8 @@ public class AccountHeadService { List list=null; try{ String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, beginTime, endTime, offset, rows); }catch(Exception e){ JshException.readFail(logger, e); @@ -111,6 +114,8 @@ public class AccountHeadService { Long result=null; try{ String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, beginTime, endTime); }catch(Exception e){ JshException.readFail(logger, e); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 95bcb049..725494ab 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -24,6 +24,7 @@ import com.jsh.erp.service.serialNumber.SerialNumberService; import com.jsh.erp.service.supplier.SupplierService; import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.StringUtil; +import com.jsh.erp.utils.Tools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -101,6 +102,8 @@ public class DepotHeadService { String [] creatorArray = getCreatorArray(roleType); Map personMap = personService.getPersonMap(); Map accountMap = accountService.getAccountMap(); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotIds, offset, rows); if (null != list) { for (DepotHeadVo4List dh : list) { @@ -144,6 +147,8 @@ public class DepotHeadService { try{ String depotIds = depotService.findDepotStrByCurrentUser(); String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotIds); }catch(Exception e){ JshException.readFail(logger, e); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index 5b55d2d5..a9b28744 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -263,8 +263,8 @@ public class DepotItemService { public BigDecimal buyOrSale(String type, String subType, Long MId, String monthTime, String sumType) throws Exception{ BigDecimal result= BigDecimal.ZERO; try{ - String beginTime = monthTime + "-01 00:00:00"; - String endTime = Tools.lastDayOfMonth(monthTime) +" 23:59:59"; + String beginTime = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; if (SUM_TYPE.equals(sumType)) { result= depotItemMapperEx.buyOrSaleNumber(type, subType, MId, beginTime, endTime, sumType); } else { @@ -288,8 +288,8 @@ public class DepotItemService { public BigDecimal inOrOutPrice(String type, String subType, String month) throws Exception{ BigDecimal result= BigDecimal.ZERO; try{ - String beginTime = month + "-01 00:00:00"; - String endTime = Tools.lastDayOfMonth(month) +" 23:59:59"; + String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME; result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime); }catch(Exception e){ JshException.readFail(logger, e); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/utils/Tools.java b/jshERP-boot/src/main/java/com/jsh/erp/utils/Tools.java index 67a517b2..18c9845d 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/utils/Tools.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/utils/Tools.java @@ -85,6 +85,14 @@ public class Tools { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); } + public static String parseDayToTime(String day, String timeStr) { + if(StringUtil.isNotEmpty(day)){ + return day + timeStr; + } else { + return null; + } + } + /** * 获得指定时间,格式为mm:ss * @@ -134,7 +142,7 @@ public class Tools { /** * 判断字符串是否全部为数字 * - * @param accountWaste + * @param checkStr * @return boolean值 */ public static boolean checkStrIsNum(String checkStr) { @@ -434,7 +442,7 @@ public class Tools { /** * 获取当前日期的前XX个月 * - * @param 之前的第几个月 + * @param beforeMonth * @return 前XX个月字符串 */ public static String getBeforeMonth(int beforeMonth) { @@ -443,6 +451,16 @@ public class Tools { return new SimpleDateFormat("yyyy-MM").format(c.getTime()); } + /** + * 根据月份获取当月第一天 + * @param monthTime + * @return + * @throws ParseException + */ + public static String firstDayOfMonth(String monthTime) throws ParseException { + return monthTime + "-01"; + } + /** * 根据月份获取当月最后一天 * @param monthTime @@ -461,7 +479,7 @@ public class Tools { /** * 获取email用户姓名 * - * @param args + * @param emailAddress */ public static String getEmailUserName(String emailAddress) { return emailAddress.substring(0, emailAddress.lastIndexOf("@")); @@ -470,7 +488,7 @@ public class Tools { /** * 获取中文编码,邮件附件乱码问题解决 * - * @param str + * @param emailAttchmentTitle * @return */ public static String getChineseString(String emailAttchmentTitle) { @@ -501,7 +519,7 @@ public class Tools { /** * 模糊判断电话号码是否合法,只能是数字 * - * @param macAddress + * @param userTel * @return */ public static boolean isTelNumberBySlur(String userTel) { diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml index f2887954..d83b7de8 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml @@ -18,16 +18,17 @@ left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1' where 1=1 - and ah.bill_no like '%${billNo}%' + + and ah.bill_no like #{bindBillNo} - and ah.type='${type}' + and ah.type=#{type} - and ah.bill_time >= '${beginTime} 00:00:00' + and ah.bill_time >= #{beginTime} - and ah.bill_time <= '${endTime} 23:59:59' + and ah.bill_time <= #{endTime} and ah.creator in ( @@ -50,16 +51,17 @@ FROM jsh_account_head WHERE 1=1 - and bill_no like '%${billNo}%' + + and bill_no like #{bindBillNo} - and type='${type}' + and type=#{type} - and bill_time >= '${beginTime} 00:00:00' + and bill_time >= #{beginTime} - and bill_time <= '${endTime} 23:59:59' + and bill_time <= #{endTime} and creator in ( @@ -73,8 +75,8 @@ @@ -86,7 +88,7 @@ left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1' where 1=1 - and ah.bill_no = '${billNo}' + and ah.bill_no = #{billNo} and ifnull(ah.delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapperEx.xml index d92535d0..2688c107 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapperEx.xml @@ -12,13 +12,15 @@ FROM jsh_account_item where 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type=${type} + and type=#{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -31,13 +33,15 @@ FROM jsh_account_item WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type=${type} + and type=#{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -46,7 +50,7 @@ select ai.*,a.Name AccountName,ioi.Name InOutItemName from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1' left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1' - where ai.header_id = ${headerId} + where ai.header_id = #{headerId} and ifnull(ai.delete_flag,'0') !='1' order by ai.id asc diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml index 753d1c79..3ac600ea 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml @@ -35,13 +35,16 @@ FROM jsh_account where 1=1 - and name like '%${name}%' + + and name like #{bindName} - - and serial_no like '%${serialNo}%' + + + and serial_no like #{bindSerialNo} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -55,13 +58,16 @@ FROM jsh_account WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - - and serial_no like '%${serialNo}%' + + + and serial_no like #{bindSerialNo} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -72,7 +78,7 @@ from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and dh.account_id=${accountId} + and dh.account_id=#{accountId} and ifnull(dh.delete_flag,'0') !='1' @@ -82,7 +88,7 @@ from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and ah.account_id=${accountId} + and ah.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -92,7 +98,7 @@ inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1' where ah.type in ('收款','付款','收预付款') - and ai.account_id=${accountId} + and ai.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -101,7 +107,7 @@ from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1' where ah.type='转账' - and ah.account_id=${accountId} + and ah.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -110,7 +116,7 @@ from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1' where ah.type='转账' - and ai.account_id=${accountId} + and ai.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -120,7 +126,8 @@ from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and dh.account_id_list like '%${accountId}%' + + and dh.account_id_list like #{bindAccountId} and ifnull(dh.delete_flag,'0') !='1' ORDER BY oTime desc @@ -137,7 +144,7 @@ from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and dh.account_id=${accountId} + and dh.account_id=#{accountId} and ifnull(dh.delete_flag,'0') !='1' @@ -146,7 +153,7 @@ from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and ah.account_id=${accountId} + and ah.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -156,7 +163,7 @@ inner join jsh_account_item ai on ai.header_id=ah.Id and ifnull(ai.delete_flag,'0') !='1' where ah.Type in ('收款','付款','收预付款') - and ai.account_id=${accountId} + and ai.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -165,7 +172,7 @@ from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1' where ah.type='转账' - and ah.account_id=${accountId} + and ah.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -174,7 +181,7 @@ from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1' where ah.type='转账' - and ai.account_id=${accountId} + and ai.account_id=#{accountId} and ifnull(ah.delete_flag,'0') !='1' @@ -183,7 +190,8 @@ from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1' where 1=1 - and dh.account_id_list like '%${accountId}%' + + and dh.account_id_list like #{bindAccountId} and ifnull(dh.delete_flag,'0') !='1' ) cc diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index 3bf03277..894572e0 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -52,29 +52,30 @@ left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1' where 1=1 - and dh.type='${type}' + and dh.type=#{type} - and dh.sub_type='${subType}' + and dh.sub_type=#{subType} - and dh.status ='${status}' + and dh.status =#{status} - and dh.number like '%${number}%' + + and dh.number like #{bindNumber} - and dh.oper_time >= '${beginTime} 00:00:00' + and dh.oper_time >= #{beginTime} - and dh.oper_time <= '${endTime} 23:59:59' + and dh.oper_time <= #{endTime} and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) - and di.depot_id in (${depotIds}) + and di.depot_id in (#{depotIds}) and dh.creator in ( @@ -97,29 +98,30 @@ left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1' WHERE 1=1 - and dh.type='${type}' + and dh.type=#{type} - and dh.sub_type='${subType}' + and dh.sub_type=#{subType} - and dh.status ='${status}' + and dh.status =#{status} - and dh.number like '%${number}%' + + and dh.number like #{bindNumber} - and dh.oper_time >= '${beginTime} 00:00:00' + and dh.oper_time >= #{beginTime} - and dh.oper_time <= '${endTime} 23:59:59' + and dh.oper_time <= #{endTime} and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) - and di.depot_id in (${depotIds}) + and di.depot_id in (#{depotIds}) and dh.creator in ( @@ -135,7 +137,7 @@ select group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',ifnull(jsh_material.model,''))) as mName from jsh_depot_item inner join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1' - where jsh_depot_item.header_id = ${id} + where jsh_depot_item.header_id = #{id} and ifnull(jsh_depot_item.delete_flag,'0') !='1' @@ -147,15 +149,15 @@ inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1' inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' - where dh.oper_time >='${beginTime} 00:00:00' and dh.oper_time <='${endTime} 23:59:59' + where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id = ${oId} + and dh.organ_id = #{oId} - and di.depot_id = ${depotId} + and di.depot_id = #{depotId} - and dh.type='${type}' + and dh.type=#{type} @@ -175,15 +177,15 @@ inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1' inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' - where dh.oper_time >='${beginTime} 00:00:00' and dh.oper_time <='${endTime} 23:59:59' + where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id = ${oId} + and dh.organ_id = #{oId} - and di.depot_id = ${depotId} + and di.depot_id = #{depotId} - and dh.type='${type}' + and dh.type=#{type} @@ -198,24 +200,24 @@ (select sum(jdi.basic_number) numSum from jsh_depot_head jdh INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' where jdi.material_id=di.material_id - and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time <='${endTime}' + and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime} - and jdh.organ_id = ${oId} + and jdh.organ_id = #{oId} - and jdi.depot_id = ${depotId} + and jdi.depot_id = #{depotId} and ifnull(jdh.delete_flag,'0') !='1' ) numSum, (select sum(jdi.all_price) priceSum from jsh_depot_head jdh INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' where jdi.material_id=di.material_id - and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time <='${endTime}' + and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime} - and jdh.organ_id = ${oId} + and jdh.organ_id = #{oId} - and jdi.depot_id = ${depotId} + and jdi.depot_id = #{depotId} and ifnull(jdh.delete_flag,'0') !='1' ) priceSum @@ -226,12 +228,12 @@ LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1' ) m - on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}' + on m.Id=di.material_id where dh.type=#{type} and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id = ${oId} + and dh.organ_id = #{oId} - and di.depot_id = ${depotId} + and di.depot_id = #{depotId} @@ -252,12 +254,12 @@ from jsh_material LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1' - ) m on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}' + ) m on m.Id=di.material_id where dh.type=#{type} and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id = ${oId} + and dh.organ_id = #{oId} - and di.depot_id = ${depotId} + and di.depot_id = #{depotId} @@ -271,20 +273,20 @@ select dh.number,concat(dh.sub_type,dh.type) as type,dh.discount_last_money,dh.other_money,dh.change_amount,s.supplier supplierName, date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depot_head dh inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' - where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单') - and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}' + where s.type=#{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单') + and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id=${organId} + and dh.organ_id=#{organId} and ifnull(dh.delete_flag,'0') !='1' UNION ALL select ah.bill_no number,ah.type as newType,ah.total_price discount_last_money, 0 other_money,ah.change_amount,s.supplier supplierName, date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_account_head ah inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1' - where s.type='${supType}' - and ah.bill_time >='${beginTime}' and ah.bill_time <='${endTime}' + where s.type=#{supType} + and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime} - and ah.organ_id=${organId} + and ah.organ_id=#{organId} and ifnull(ah.delete_flag,'0') !='1' ORDER BY oTime @@ -298,33 +300,33 @@ ( select count(1) a from jsh_depot_head dh inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' - where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单') - and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}' + where s.type=#{supType} and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单') + and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} - and dh.organ_id=${organId} + and dh.organ_id=#{organId} and ifnull(dh.delete_flag,'0') !='1' UNION ALL select count(1) a from jsh_account_head ah inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1' - where s.type='${supType}' - and ah.bill_time >='${beginTime}' and ah.bill_time <='${endTime}' + where s.type=#{supType} + and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime} - and ah.organ_id=${organId} + and ah.organ_id=#{organId} and ifnull(ah.delete_flag,'0') !='1' ) cc @@ -335,7 +337,7 @@ left join jsh_account a on dh.account_id=a.id and ifnull(a.delete_Flag,'0') !='1' where 1=1 - and dh.number='${number}' + and dh.number=#{number} and ifnull(dh.delete_flag,'0') !='1' @@ -393,10 +395,10 @@ FROM jsh_depot_head WHERE 1=1 - and type='${type}' + and type=#{type} - and sub_type='${subType}' + and sub_type=#{subType} and organ_id is not null @@ -405,10 +407,10 @@ and organ_id is null - and oper_time >= '${beginTime}' + and oper_time >= #{beginTime} - and oper_time <= '${endTime}' + and oper_time <= #{endTime} and ifnull(delete_flag,'0') !='1' @@ -419,10 +421,10 @@ FROM jsh_depot_head WHERE 1=1 - and type='${type}' + and type=#{type} - and sub_type='${subType}' + and sub_type=#{subType} and organ_id is not null @@ -431,10 +433,10 @@ and organ_id is null - and oper_time >= '${beginTime}' + and oper_time >= #{beginTime} - and oper_time <= '${endTime}' + and oper_time <= #{endTime} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml index 8422a113..1722079e 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -76,13 +76,15 @@ FROM jsh_depot_item where 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type=${type} + and type = #{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -96,13 +98,15 @@ FROM jsh_depot_item WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type=${type} + and type = #{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -128,7 +132,7 @@ or (dh.type='其它' and dh.sub_type='组装单') or (dh.type='其它' and dh.sub_type='拆卸单') or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1)) - and di.material_id =${mId} + and di.material_id = #{mId} and ifnull(dh.delete_flag,'0') !='1' ORDER BY oTime desc @@ -144,7 +148,7 @@ or (dh.type='其它' and dh.sub_type='组装单') or (dh.type='其它' and dh.sub_type='拆卸单') or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1)) - and di.material_id =${mId} + and di.material_id =#{mId} and ifnull(dh.delete_flag,'0') !='1' @@ -158,7 +162,7 @@ left join jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_depot dp1 on di.depot_id=dp1.id and ifnull(dp1.delete_Flag,'0') !='1' left join jsh_depot dp2 on di.another_depot_id=dp2.id and ifnull(dp2.delete_Flag,'0') !='1' - where di.header_id = ${headerId} + where di.header_id = #{headerId} and ifnull(di.delete_flag,'0') !='1' order by di.id asc @@ -180,7 +184,7 @@ and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) - and dh.oper_time <= '${endTime}' + and dh.oper_time <= #{endTime} and ifnull(m.delete_flag,'0') !='1' group by m.id,m.name, m.model, m.unit, m.color, u.name @@ -201,7 +205,7 @@ and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) - and dh.oper_time <= '${endTime}' + and dh.oper_time <= #{endTime} and ifnull(di.delete_flag,'0') !='1' group by m.id) cc @@ -210,8 +214,8 @@ select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh where di.header_id = dh.id - and dh.type='${type}' and dh.sub_type='${subType}' - and di.material_id =${MId} + and dh.type=#{type} and dh.sub_type=#{subType} + and di.material_id =#{MId} and dh.oper_time >= #{beginTime} and dh.oper_time <= #{endTime} and ifnull(dh.delete_flag,'0') !='1' @@ -232,7 +236,7 @@ diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml index e928ab4b..d462ce96 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml @@ -11,13 +11,15 @@ left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2') where 1=1 - and dep.name like '%${name}%' + + and dep.name like #{bindName} - and dep.type=${type} + and dep.type=#{type} - and dep.remark like '%${remark}%' + + and dep.remark like #{bindRemark} and ifnull(dep.delete_Flag,'0') !='1' order by dep.sort asc @@ -32,13 +34,15 @@ left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2') WHERE 1=1 - and dep.name like '%${name}%' + + and dep.name like #{bindName} - and dep.type=${type} + and dep.type=#{type} - and dep.remark like '%${remark}%' + + and dep.remark like #{bindRemark} and ifnull(dep.delete_Flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/FunctionMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/FunctionMapperEx.xml index 095ab593..7219eac3 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/FunctionMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/FunctionMapperEx.xml @@ -6,10 +6,11 @@ FROM jsh_function where 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} and ifnull(delete_flag,'0') !='1' order by sort asc @@ -23,10 +24,11 @@ FROM jsh_function WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/InOutItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/InOutItemMapperEx.xml index d3315ec5..977a57ad 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/InOutItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/InOutItemMapperEx.xml @@ -6,13 +6,15 @@ FROM jsh_in_out_item where 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' @@ -25,13 +27,15 @@ FROM jsh_in_out_item WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} - and remark like '%${remark}%' + + and remark like #{bindRemark} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml index c593800c..e5094c63 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml @@ -11,25 +11,28 @@ left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2') where 1=1 - and l.operation like '%${operation}%' + + and l.operation like #{bindOperation} - and l.user_id=${userId} + and l.user_id=#{userId} - and l.client_ip like '%${clientIp}%' + + and l.client_ip like #{bindClientIp} - and l.status=${status} + and l.status=#{status} - and l.create_time >= '${beginTime}' + and l.create_time >= #{beginTime} - and l.create_time <= '${endTime}' + and l.create_time <= #{endTime} - and l.content like '%${content}%' + + and l.content like #{bindContent} order by l.create_time desc @@ -43,25 +46,28 @@ left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2') WHERE 1=1 - and l.operation like '%${operation}%' + + and l.operation like #{bindOperation} - and l.user_id=${userId} + and l.user_id=#{userId} - and l.client_ip like '%${clientIp}%' + + and l.client_ip like #{bindClientIp} - and l.status = ${status} + and l.status = #{status} - and l.create_time >= '${beginTime}' + and l.create_time >= #{beginTime} - and l.create_time <= '${endTime}' + and l.create_time <= #{endTime} - and l.content like '%${content}%' + + and l.content like #{bindContent} \ No newline at end of file diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml index 765b1c95..a11cdefd 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml @@ -7,10 +7,11 @@ where 1=1 and ifnull(delete_flag,'0') !='1' - and name like '%${name}%' + + and name like #{bindName} - and parent_id = ${parentId} + and parent_id = #{parentId} and Id !=1 @@ -24,10 +25,11 @@ WHERE 1=1 and ifnull(delete_flag,'0') !='1' - and name like '%${name}%' + + and name like #{bindName} - and parent_id = ${parentId} + and parent_id = #{parentId} and Id !=1 diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml index a7577dac..76de1635 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml @@ -8,7 +8,7 @@ @@ -19,7 +19,7 @@ select update_time from jsh_material_extend where 1=1 - and update_time > ${lastTime} + and update_time > #{lastTime} order by update_time asc diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml index 25d4e379..31c6907b 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -26,16 +26,20 @@ where 1=1 and me.default_flag=1 - and me.bar_code like '%${barCode}%' + + and me.bar_code like #{bindBarCode} - and m.name like '%${name}%' + + and m.name like #{bindName} - and m.standard like '%${standard}%' + + and m.standard like #{bindStandard} - and m.model like '%${model}%' + + and m.model like #{bindModel} and m.category_id in @@ -60,16 +64,20 @@ WHERE 1=1 and me.default_flag=1 - and me.bar_code like '%${barCode}%' + + and me.bar_code like #{bindBarCode} - and m.name like '%${name}%' + + and m.name like #{bindName} - and m.standard like '%${standard}%' + + and m.standard like #{bindStandard} - and m.model like '%${model}%' + + and m.model like #{bindModel} and m.category_id in @@ -83,14 +91,14 @@ @@ -100,7 +108,7 @@ from jsh_material m left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' - where me.id = ${meId} + where me.id = #{meId} and ifnull(m.delete_flag,'0') !='1' @@ -133,7 +141,8 @@ left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' where m.enabled=1 and me.id is not null - and (m.name like '%${q}%' or me.bar_code like '%${q}%') + + and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) and m.category_id in @@ -154,16 +163,20 @@ where 1=1 and me.default_flag=1 - and me.bar_code like '%${barCode}%' + + and me.bar_code like #{bindBarCode} - and m.name like '%${name}%' + + and m.name like #{bindName} - and m.standard like '%${standard}%' + + and m.standard like #{bindStandard} - and m.model like '%${model}%' + + and m.model like #{bindModel} and m.category_id in @@ -264,7 +277,7 @@ left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' where 1=1 - and me.id = ${meId} + and me.id = #{meId} and ifnull(m.delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml index 16893ec2..0dce6dec 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml @@ -6,7 +6,8 @@ FROM jsh_material_property where 1=1 - and native_name like '%${name}%' + + and native_name like #{bindName} and ifnull(delete_flag,'0') !='1' @@ -19,7 +20,8 @@ FROM jsh_material_property WHERE 1=1 - and native_name like '%${name}%' + + and native_name like #{bindName} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml index c31e3e9d..fde45a18 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml @@ -7,7 +7,8 @@ WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - and msg_title like '%${name}%' + + and msg_title like #{bindName} order by create_time desc @@ -21,7 +22,8 @@ WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - and msg_title like '%${name}%' + + and msg_title like #{bindName} @@ -54,7 +56,7 @@ WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - and msg_title = '${msgTitle}' + and msg_title = #{msgTitle} @@ -65,7 +67,7 @@ WHERE 1=1 and ifnull(delete_Flag,'0') !='1' - and status = '${status}' + and status = #{status} \ No newline at end of file diff --git a/jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml index 2cb895f7..94df794d 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml @@ -6,10 +6,11 @@ FROM jsh_person where 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} and ifnull(delete_flag,'0') !='1' @@ -22,10 +23,11 @@ FROM jsh_person WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} - and type='${type}' + and type=#{type} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml index ea94451a..fde477a9 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml @@ -7,7 +7,8 @@ WHERE 1=1 and ifnull(delete_flag,'0') !='1' - and name like '%${name}%' + + and name like #{bindName} limit #{offset},#{rows} @@ -20,7 +21,8 @@ WHERE 1=1 and ifnull(delete_flag,'0') !='1' - and name like '%${name}%' + + and name like #{bindName} diff --git a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml index bb2ab6ec..3383f42a 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/SupplierMapperEx.xml @@ -6,16 +6,19 @@ FROM jsh_supplier where 1=1 - and supplier like '%${supplier}%' + + and supplier like #{bindSupplier} - and type='${type}' + and type=#{type} - and phone_num like '%${phonenum}%' + + and phone_num like #{bindPhoneNum} - and telephone like '%${telephone}%' + + and telephone like #{bindTelephone} and ifnull(delete_flag,'0') !='1' order by id desc @@ -29,16 +32,19 @@ FROM jsh_supplier WHERE 1=1 - and supplier like '%${supplier}%' + + and supplier like #{bindSupplier} - and type='${type}' + and type=#{type} - and phone_num like '%${phonenum}%' + + and phone_num like #{bindPhoneNum} - and telephone like '%${telephone}%' + + and telephone like #{bindTelephone} and ifnull(delete_flag,'0') !='1' @@ -48,16 +54,19 @@ FROM jsh_supplier where 1=1 - and supplier like '%${supplier}%' + + and supplier like #{bindSupplier} - and type='${type}' + and type=#{type} - and phone_num like '%${phonenum}%' + + and phone_num like #{bindPhoneNum} - and telephone like '%${telephone}%' + + and telephone like #{bindTelephone} and ifnull(delete_flag,'0') !='1' order by id desc diff --git a/jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapperEx.xml index 44df159b..0473f86a 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapperEx.xml @@ -6,7 +6,8 @@ FROM jsh_system_config where 1=1 - and company_name like '%${companyName}%' + + and company_name like #{bindCompanyName} and ifnull(delete_flag,'0') !='1' @@ -19,7 +20,8 @@ FROM jsh_system_config WHERE 1=1 - and company_name like '%${companyName}%' + + and company_name like #{bindCompanyName} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml index a0570e50..ad956e96 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml @@ -10,7 +10,8 @@ FROM jsh_tenant where 1=1 - and login_name like '%${loginName}%' + + and login_name like #{bindLoginName} order by id desc @@ -23,7 +24,8 @@ FROM jsh_tenant WHERE 1=1 - and login_name like '%${loginName}%' + + and login_name like #{bindLoginName} \ No newline at end of file diff --git a/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml index 821446d4..05e9a557 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml @@ -6,7 +6,8 @@ FROM jsh_unit where 1=1 - and name like '%${name}%' + + and name like #{bindName} and ifnull(delete_flag,'0') !='1' @@ -19,7 +20,8 @@ FROM jsh_unit WHERE 1=1 - and name like '%${name}%' + + and name like #{bindName} and ifnull(delete_flag,'0') !='1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml index 4d81d0e6..f6d55a28 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml @@ -25,10 +25,12 @@ where 1=1 and ifnull(user.status,'0') not in('1','2') - and user.username like '%${userName}%' + + and user.username like #{bindUserName} - and user.login_name like '%${loginName}%' + + and user.login_name like #{bindLoginName} order by rel.user_blng_orga_dspl_seq,user.id desc @@ -41,10 +43,12 @@ where 1=1 and ifnull(user.status,'0') not in('1','2') - and user.username like '%${userName}%' + + and user.username like #{bindUserName} - and user.login_name like '%${loginName}%' + + and user.login_name like #{bindLoginName}