소스 검색

修改查询修改碳源投加参数的历史接口SQL的bug修改 默认时间改成yyyy-MM-dd的格式

王苗苗 6 달 전
부모
커밋
4a62b2fee9

+ 2 - 2
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiMedicineParamServiceImpl.java

@@ -65,9 +65,9 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
         Date nowDate = DateUtils.getNowDate();
         Date dayBefore7 = DateUtils.plusDate(-7, nowDate);
         if(StringUtils.isBlank(timeBegin))
-            tXinyiMedicineParam.setTimeBegin(DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, dayBefore7));
+            tXinyiMedicineParam.setTimeBegin(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dayBefore7));
         if(StringUtils.isBlank(timeEnd))
-            tXinyiMedicineParam.setTimeEnd(DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, nowDate));
+            tXinyiMedicineParam.setTimeEnd(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, nowDate));
         return tXinyiMedicineParamMapper.selectTXinyiMedicineParamList(tXinyiMedicineParam);
     }
 

+ 1 - 1
slibra-system/src/main/resources/mapper/business/TXinyiMedicineParamMapper.xml

@@ -249,7 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="revision != null "> and revision = #{revision}</if>
             <!-- 下面是新增的SQL检索条件  MySQL写法-->
             <if test="timeBegin != null  and timeBegin != ''"> and DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= #{timeBegin}</if>
-            <if test="timeEnd != null  and timeEnd != ''"> DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{timeEnd}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{timeEnd}</if>
         </where>
         and del_flag = 0 order by id desc
     </select>