ソースを参照

sql语句调整 del_flag 查询日期,因为存储字符串调整

王苗苗 6 ヶ月 前
コミット
4fef9b10c7

BIN
.DS_Store


+ 2 - 2
src/main/java/com/xlht/xlhtproject/service/impl/FrontServiceImpl.java

@@ -36,8 +36,8 @@ public class FrontServiceImpl implements IFrontService {
         Date dayBefore7 = DateUtils.plusDate(-1, nowDate);
         //2024年09月13日17:02:59 支持前段自定义起止时间
         //先用日期获取当天和前一天的数据,如果获取不到,则提示错误信息
-        String nowDateStr = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, nowDate) : timeEnd;
-        String dayBefore1Str = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYYMMDD_TS, dayBefore7) : timeBegin;
+        String nowDateStr = StringUtils.isBlank(timeEnd) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, nowDate) : timeEnd;
+        String dayBefore1Str = StringUtils.isBlank(timeBegin) ? DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dayBefore7) : timeBegin;
         //返回的对象
         Map<String, List<ChartBasic>> result = new HashMap<>();
         //获取筛选日期内的所有的数据

+ 4 - 4
src/main/resources/mapper/TShuju1Mapper.xml

@@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTShuju1ByID" parameterType="Long" resultMap="TShuju1Result">
         <include refid="selectTShuju1Vo"/>
-        where ID = #{ID} and del_flag = 0
+        where ID = #{ID}
     </select>
         
     <insert id="insertTShuju1" parameterType="TShuju1">
@@ -251,9 +251,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="jqrSwcZhenglin != null "> and JQR_SWC_ZHENGLIN = #{jqrSwcZhenglin}</if>
             <if test="jqrSwcZhenglinTime != null  and jqrSwcZhenglinTime != ''"> and JQR_SWC_ZHENGLIN_TIME = #{jqrSwcZhenglinTime}</if>
             <!-- 下面是新增的SQL检索条件  SqlServer写法-->
-            <if test="timeBegin != null  and timeBegin != ''"> and SUBSTRING (CONVERT ( VARCHAR, create_time, 120 ), 1, 10 ) &gt;= #{timeBegin}</if>
-            <if test="timeEnd != null  and timeEnd != ''"> and SUBSTRING (CONVERT ( VARCHAR, create_time, 120 ), 1, 10 ) &lt;= #{timeEnd}</if>
+            <if test="timeBegin != null  and timeBegin != ''"> and SUBSTRING (TIME, 1, 10 ) &gt;= #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and SUBSTRING (TIME, 1, 10 ) &lt;= #{timeEnd}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
 </mapper>

+ 2 - 2
src/main/resources/mapper/TTbDuMapper.xml

@@ -27,12 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="c2TjLlTime != null  and c2TjLlTime != ''"> and C2_TJ_LL_TIME = #{c2TjLlTime}</if>
             <if test="ACTIVE != null "> and ACTIVE = #{ACTIVE}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
     
     <select id="selectTTbDuByID" parameterType="Long" resultMap="TTbDuResult">
         <include refid="selectTTbDuVo"/>
-        where ID = #{ID} and del_flag = 0
+        where ID = #{ID}
     </select>
         
     <insert id="insertTTbDu" parameterType="TTbDu">

+ 2 - 2
src/main/resources/mapper/TTbXieMapper.xml

@@ -27,12 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="jqrLcId != null  and jqrLcId != ''"> and jqr_lc_ID = #{jqrLcId}</if>
             <if test="jqrLcBj != null "> and jqr_lc_bj = #{jqrLcBj}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
     
     <select id="selectTTbXieByID" parameterType="Long" resultMap="TTbXieResult">
         <include refid="selectTTbXieVo"/>
-        where ID = #{ID} and del_flag = 0
+        where ID = #{ID}
     </select>
         
     <insert id="insertTTbXie" parameterType="TTbXie">

+ 2 - 2
src/main/resources/mapper/ZAssayFaultMapper.xml

@@ -51,12 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stepInfo2 != null  and stepInfo2 != ''"> and step_info2 = #{stepInfo2}</if>
             <if test="stepInfo3 != null  and stepInfo3 != ''"> and step_info3 = #{stepInfo3}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
     
     <select id="selectZAssayFaultByFaultId" parameterType="Long" resultMap="ZAssayFaultResult">
         <include refid="selectZAssayFaultVo"/>
-        where fault_id = #{faultId} and del_flag = 0
+        where fault_id = #{faultId}
     </select>
         
     <insert id="insertZAssayFault" parameterType="ZAssayFault">

+ 2 - 2
src/main/resources/mapper/ZAssayMapper.xml

@@ -57,12 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="assayStatus != null  and assayStatus != ''"> and assay_status = #{assayStatus}</if>
             <if test="assayMethod != null  and assayMethod != ''"> and assay_method = #{assayMethod}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
     
     <select id="selectZAssayByAssayId" parameterType="Long" resultMap="ZAssayResult">
         <include refid="selectZAssayVo"/>
-        where assay_id = #{assayId} and del_flag = 0
+        where assay_id = #{assayId}
     </select>
         
     <insert id="insertZAssay" parameterType="ZAssay">

+ 2 - 2
src/main/resources/mapper/ZAssayResultMapper.xml

@@ -87,12 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="readFlag != null  and readFlag != ''"> and read_flag = #{readFlag}</if>
             <if test="tongbuZt != null  and tongbuZt != ''"> and tongbu_zt = #{tongbuZt}</if>
         </where>
-        and del_flag = 0 order by id desc
+        order by id desc
     </select>
     
     <select id="selectZAssayResultByResultId" parameterType="Long" resultMap="ZAssayResultResult">
         <include refid="selectZAssayResultVo"/>
-        where result_id = #{resultId} and del_flag = 0
+        where result_id = #{resultId}
     </select>
         
     <insert id="insertZAssayResult" parameterType="ZAssayResult">