Ver código fonte

【制度查询】日期类型数据转换、模糊查询功能代码修改

peifj 6 meses atrás
pai
commit
5b989ba9dc

+ 6 - 4
ruoyi-zzb/src/main/java/com/ruoyi/zzb/zdcx/service/ZdcxService.java

@@ -7,6 +7,7 @@ import com.ruoyi.common.annotation.DataSource;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.zzb.zdcx.domain.Zdcx;
 import com.ruoyi.zzb.zdcx.mapper.ZdcxMapper;
 import lombok.extern.slf4j.Slf4j;
@@ -46,19 +47,19 @@ public class ZdcxService {
             if (queryFlag != 0){              // or
                 queryWrapper.or();
             }
-            queryWrapper.eq("DOC_ID", docId);
+            queryWrapper.like("DOC_ID", docId);
         }
         if(StringUtils.isNotBlank(title)){
             if (queryFlag != 0){
                 queryWrapper.or();
             }
-            queryWrapper.eq("TITLE", title);
+            queryWrapper.like("TITLE", title);
         }
         if(StringUtils.isNotBlank(publishDept)){
             if (queryFlag != 0){
                 queryWrapper.or();
             }
-            queryWrapper.eq("PUBLISH_DEPT", publishDept);
+            queryWrapper.like("PUBLISH_DEPT", publishDept);
         }
         if(StringUtils.isNotBlank(content)){
             if (queryFlag != 0){
@@ -70,7 +71,8 @@ public class ZdcxService {
             if (queryFlag != 0){
                 queryWrapper.or();
             }
-            queryWrapper.between("CREATE_TIME", startTime, endTime);
+//            queryWrapper.between("CREATE_TIME", startTime, endTime);
+            queryWrapper.between("CREATE_TIME", DateUtils.parseDate(startTime), DateUtils.parseDate(endTime));
         }
         Page<Zdcx> page = new Page<>(pageIndex, pageSize);
         return zdcxMapper.selectPage(page, queryWrapper);

+ 0 - 1
ruoyi-zzb/src/main/java/com/ruoyi/zzb/zyww/service/ZywwService.java

@@ -24,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 @Slf4j