Explorar o código

修复部分查询BUG

leon %!s(int64=4) %!d(string=hai) anos
pai
achega
2fc4826d9d

+ 3 - 0
src/main/java/com/mokamrp/privates/entity/PostBasePageHandle.java

@@ -14,8 +14,11 @@ public class PostBasePageHandle {
     private String title;
     private String name;
     private Integer type;
+    private Integer taskType;
     private Integer templateId;
     private Integer catalogId;
+    private String ghId;
+    private Integer uploadUid;
     public Integer getPage() {
         return page;
     }

+ 6 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashOasBoxMapper.xml

@@ -27,6 +27,12 @@
         SELECT * FROM pan_fosterwx_cash_oas_box
         <where>
             <if test="params.groupId != null">and group_id = #{params.groupId}</if>
+            <if test="params.id != null">and id = #{params.id}</if>
+            <if test="params.stationId != null">and station_id = #{params.stationId}</if>
+            <if test="params.type != null">and type = #{params.type}</if>
+            <if test="params.name != null">and name like concat('%',#{params.groupId},'%')</if>
+            <if test="params.ghId != null">and gh_id = #{params.ghId}</if>
+            <if test="params.uploadUid != null">and upload_uid = #{params.uploadUid}</if>
         </where>
         order by id desc
     </select>

+ 1 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashTaskTemplateMapper.java

@@ -19,4 +19,5 @@ import java.util.List;
 @Component
 public interface FosterwxCashTaskTemplateMapper extends BaseMapper<FosterwxCashTaskTemplate> {
     public List<FosterwxCashTaskTemplate> getList(Page<FosterwxCashTaskTemplate> pageObj, @Param("params")PostBasePageHandle handle);
+    public List<FosterwxCashTaskTemplate> getWorkwxList(Page<FosterwxCashTaskTemplate> pageObj, @Param("params")PostBasePageHandle handle);
 }

+ 16 - 2
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashTaskTemplateMapper.xml

@@ -21,7 +21,7 @@
     <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskTemplate">
         SELECT A.* FROM pan_fosterwx_cash_task_template as A
         <if test="params.title != null">
-            left join (select template_id,title from pan_fosterwx_cash_task_list where title like concat('%',#{params.title},'%') group by template_id,title) as B
+            left join (select template_id from pan_fosterwx_cash_task_list where title like concat('%',#{params.title},'%') group by template_id) as B
             on B.template_id = A.id
         </if>
         where A.del_flg = 1
@@ -29,7 +29,21 @@
         <if test="params.name != null">and A.template_name like concat('%',#{params.name},'%')</if>
         <if test="params.createUid != null">and A.create_uid = #{params.createUid}</if>
         <if test="params.id != null">and A.id = #{params.id}</if>
-        <if test="params.title != null">and B.title is not null</if>
+        <if test="params.title != null">and B.template_id is not null</if>
         order by id desc
     </select>
+    <select id="getWorkwxList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskTemplate">
+        SELECT A.* FROM pan_fosterwx_cash_task_template as A
+        <if test="params.title != null">
+            left join (select template_id from pan_fosterwx_cash_workwx_task_list where title like concat('%',#{params.title},'%') group by template_id) as B
+            on B.template_id = A.id
+        </if>
+        where A.del_flg = 1
+        <if test="params.type != null">and A.template_type = #{params.type}</if>
+        <if test="params.name != null">and A.template_name like concat('%',#{params.name},'%')</if>
+        <if test="params.createUid != null">and A.create_uid = #{params.createUid}</if>
+        <if test="params.id != null">and A.id = #{params.id}</if>
+        <if test="params.title != null">and B.template_id is not null</if>
+        order by A.id desc
+    </select>
 </mapper>

+ 2 - 2
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashWorkwxTaskCatalogMapper.xml

@@ -47,7 +47,7 @@
                  left join pan_fosterwx_cash_workwx_task_list as B on A.id = B.catalog_id
         where A.del_flg = 1
         <if test="params.templateId != null">and A.template_id = #{params.templateId}</if>
-        <if test="params.title != null">and A.title = #{params.title}</if>
-        order by send_at desc
+        <if test="params.title != null">and B.title like concat('%',#{params.title},'%')</if>
+        order by A.send_at desc
     </select>
 </mapper>

+ 6 - 1
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashTaskTemplateServiceImpl.java

@@ -46,7 +46,12 @@ public class FosterwxCashTaskTemplateServiceImpl extends ServiceImpl<FosterwxCas
         Integer pagesize = handle.getPagesize();
         Integer page = handle.getPage();
         Page<FosterwxCashTaskTemplate> pageObj = new Page<FosterwxCashTaskTemplate>(page, pagesize);
-        List<FosterwxCashTaskTemplate> list = fosterwxCashTaskTemplateMapper.getList(pageObj,handle);
+        List<FosterwxCashTaskTemplate> list = new ArrayList<>();
+        if(handle.getType() == 1){
+            list = fosterwxCashTaskTemplateMapper.getList(pageObj,handle);
+        }else{
+            list = fosterwxCashTaskTemplateMapper.getWorkwxList(pageObj,handle);
+        }
         ResHandle<List<FosterwxCashTaskTemplate>> res = new ResHandle<>();
         res.setList(list);
         res.setTotal(pageObj.getTotal());

+ 0 - 1
src/main/java/com/mokamrp/privates/task/pangu/SyncNewFosterwxTask.java

@@ -62,7 +62,6 @@ public class SyncNewFosterwxTask {
                 fosterwxTaskScheduleHandle.setPage(1);
                 fosterwxTaskScheduleHandle.setPagesize(99999);
                 ResHandle<List<FosterwxTaskSchedule>> resHandle = fosterwxTaskScheduleService.getList(fosterwxTaskScheduleHandle);
-                System.out.println(resHandle);
                 List<FosterwxTaskSchedule> fosterwxTaskScheduleList = resHandle.getList();
                 for (FosterwxTaskSchedule fosterwxTaskSchedule : fosterwxTaskScheduleList) {
                     String sendDate = fosterwxTaskSchedule.getSendDate().toString();