日期和sql优化

This commit is contained in:
季圣华
2021-06-09 20:29:36 +08:00
parent f04dcd220c
commit 99e7db36d3
30 changed files with 361 additions and 243 deletions

View File

@@ -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);