zyw 8 місяців тому
батько
коміт
c2ddb310fe
21 змінених файлів з 989 додано та 42 видалено
  1. 10 1
      pom.xml
  2. 2 2
      src/main/java/com/zhaoliangsz/grainsearch/CodeGenerator.java
  3. 2 0
      src/main/java/com/zhaoliangsz/grainsearch/GrainSearchApplication.java
  4. 73 0
      src/main/java/com/zhaoliangsz/grainsearch/controller/AskLeaveController.java
  5. 73 0
      src/main/java/com/zhaoliangsz/grainsearch/controller/SzgcColorController.java
  6. 20 8
      src/main/java/com/zhaoliangsz/grainsearch/controller/TestTableController.java
  7. 51 0
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/AskLeave.java
  8. 53 0
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/SzgcColor.java
  9. 4 1
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/TestTable.java
  10. 32 0
      src/main/java/com/zhaoliangsz/grainsearch/mapper/AskLeaveMapper.java
  11. 32 0
      src/main/java/com/zhaoliangsz/grainsearch/mapper/SzgcColorMapper.java
  12. 2 0
      src/main/java/com/zhaoliangsz/grainsearch/mapper/TestTableMapper.java
  13. 40 0
      src/main/java/com/zhaoliangsz/grainsearch/service/IAskLeaveService.java
  14. 40 0
      src/main/java/com/zhaoliangsz/grainsearch/service/ISzgcColorService.java
  15. 9 2
      src/main/java/com/zhaoliangsz/grainsearch/service/ITestTableService.java
  16. 82 0
      src/main/java/com/zhaoliangsz/grainsearch/service/impl/AskLeaveServiceImpl.java
  17. 82 0
      src/main/java/com/zhaoliangsz/grainsearch/service/impl/SzgcColorServiceImpl.java
  18. 281 28
      src/main/java/com/zhaoliangsz/grainsearch/service/impl/TestTableServiceImpl.java
  19. 39 0
      src/main/resources/mapper/AskLeaveMapper.xml
  20. 42 0
      src/main/resources/mapper/SzgcColorMapper.xml
  21. 20 0
      src/main/resources/mapper/TestTableMapper.xml

+ 10 - 1
pom.xml

@@ -21,7 +21,11 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.13</version> <!-- 请使用最新的稳定版本 -->
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
@@ -80,6 +84,11 @@
             <artifactId>velocity-engine-core</artifactId>
             <version>2.3</version>
         </dependency>
+         <dependency>
+        <groupId>com.alibaba</groupId>
+        <artifactId>fastjson</artifactId>
+        <version>1.2.73</version>
+    </dependency>
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>

+ 2 - 2
src/main/java/com/zhaoliangsz/grainsearch/CodeGenerator.java

@@ -26,7 +26,7 @@ public class CodeGenerator {
     /**
      * 数据库链接地址
      */
-    private static final String URL = "jdbc:mysql://10.23.250.88:3306/h5?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=UTC";
+    private static final String URL = "jdbc:mysql://10.23.250.88:3306/dt?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=UTC";
 
     /**
      * 用户名
@@ -56,7 +56,7 @@ public class CodeGenerator {
     /**
      * 需要生成的表名,必填
      */
-    private static final List<String> TABLES = ListUtil.toList("test","inventory_table");
+    private static final List<String> TABLES = ListUtil.toList("test","szgc_color");
 
 
     public static void main(String[] args) {

+ 2 - 0
src/main/java/com/zhaoliangsz/grainsearch/GrainSearchApplication.java

@@ -4,10 +4,12 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 @MapperScan(basePackages = {"com.zhaoliangsz.grainsearch.mapper"})
 @ComponentScan(basePackages = "com.zhaoliangsz.grainsearch.*")
 @SpringBootApplication
+@EnableScheduling
 public class GrainSearchApplication {
 
     public static void main(String[] args) {

+ 73 - 0
src/main/java/com/zhaoliangsz/grainsearch/controller/AskLeaveController.java

@@ -0,0 +1,73 @@
+package com.zhaoliangsz.grainsearch.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import lombok.extern.slf4j.Slf4j;
+import javax.annotation.Resource;
+import com.zhaoliangsz.grainsearch.service.IAskLeaveService;
+import org.springframework.web.bind.annotation.*;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+import com.zhaoliangsz.grainsearch.domain.entity.AskLeave;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-02-18 10:28:10
+ */
+@RestController
+@Slf4j
+@RequestMapping("/v1/askLeave")
+public class AskLeaveController {
+    @Resource
+    private IAskLeaveService myIAskLeaveService;
+    /**
+     * 获取AskLeave
+     * @return
+     */
+    @GetMapping
+    public PageResult<AskLeave> queryAskLeaveList(AskLeave queryAskLeave) throws ServiceException {
+        log.info("[AskLeaveController.queryAskLeaveList]获取AskLeave列表开始参数:{}",queryAskLeave);
+        PageResult<AskLeave> page = myIAskLeaveService.queryAskLeaveList(queryAskLeave);
+        log.info("[AskLeaveController.queryAskLeaveList]获取AskLeave列表结束结果:{}",page);
+        return page;
+    }
+    /**
+     * 新增AskLeave
+     * @return
+     */
+    @PostMapping
+    public String addAskLeave(@RequestBody AskLeave addAskLeave) throws ServiceException {
+        log.info("[AskLeaveController.addAskLeave]新增AskLeave开始addAskLeave:{}",addAskLeave);
+        String result = myIAskLeaveService.addAskLeave(addAskLeave);
+        log.info("[AskLeaveController.addAskLeave]新增AskLeave结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 编辑AskLeave
+     * @return
+     */
+    @PutMapping
+    public String editAskLeave(@RequestBody AskLeave editAskLeave) throws ServiceException {
+        log.info("[AskLeaveController.editAskLeave]编辑AskLeave开始参数:{}",editAskLeave);
+        String result = myIAskLeaveService.editAskLeave(editAskLeave);
+        log.info("[AskLeaveController.editAskLeave]编辑AskLeave结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 删除AskLeave
+     * @return
+     */
+    @DeleteMapping
+    public String deleteAskLeave(@RequestBody AskLeave deleteAskLeave) throws ServiceException {
+        log.info("[AskLeaveController.deleteAskLeave]删除AskLeave开始参数:{}",deleteAskLeave);
+        String result = myIAskLeaveService.deleteAskLeave(deleteAskLeave);
+        log.info("[AskLeaveController.deleteAskLeave]删除AskLeave结束结果:{}",result);
+        return result;
+    }
+}
+

+ 73 - 0
src/main/java/com/zhaoliangsz/grainsearch/controller/SzgcColorController.java

@@ -0,0 +1,73 @@
+package com.zhaoliangsz.grainsearch.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import lombok.extern.slf4j.Slf4j;
+import javax.annotation.Resource;
+import com.zhaoliangsz.grainsearch.service.ISzgcColorService;
+import org.springframework.web.bind.annotation.*;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+import com.zhaoliangsz.grainsearch.domain.entity.SzgcColor;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-04-03 13:22:38
+ */
+@RestController
+@Slf4j
+@RequestMapping("/v1/szgcColor")
+public class SzgcColorController {
+    @Resource
+    private ISzgcColorService myISzgcColorService;
+    /**
+     * 获取SzgcColor
+     * @return
+     */
+    @GetMapping
+    public PageResult<SzgcColor> querySzgcColorList(SzgcColor querySzgcColor) throws ServiceException {
+        log.info("[SzgcColorController.querySzgcColorList]获取SzgcColor列表开始参数:{}",querySzgcColor);
+        PageResult<SzgcColor> page = myISzgcColorService.querySzgcColorList(querySzgcColor);
+        log.info("[SzgcColorController.querySzgcColorList]获取SzgcColor列表结束结果:{}",page);
+        return page;
+    }
+    /**
+     * 新增SzgcColor
+     * @return
+     */
+    @PostMapping
+    public String addSzgcColor(@RequestBody SzgcColor addSzgcColor) throws ServiceException {
+        log.info("[SzgcColorController.addSzgcColor]新增SzgcColor开始addSzgcColor:{}",addSzgcColor);
+        String result = myISzgcColorService.addSzgcColor(addSzgcColor);
+        log.info("[SzgcColorController.addSzgcColor]新增SzgcColor结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 编辑SzgcColor
+     * @return
+     */
+    @PutMapping
+    public String editSzgcColor(@RequestBody SzgcColor editSzgcColor) throws ServiceException {
+        log.info("[SzgcColorController.editSzgcColor]编辑SzgcColor开始参数:{}",editSzgcColor);
+        String result = myISzgcColorService.editSzgcColor(editSzgcColor);
+        log.info("[SzgcColorController.editSzgcColor]编辑SzgcColor结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 删除SzgcColor
+     * @return
+     */
+    @DeleteMapping
+    public String deleteSzgcColor(@RequestBody SzgcColor deleteSzgcColor) throws ServiceException {
+        log.info("[SzgcColorController.deleteSzgcColor]删除SzgcColor开始参数:{}",deleteSzgcColor);
+        String result = myISzgcColorService.deleteSzgcColor(deleteSzgcColor);
+        log.info("[SzgcColorController.deleteSzgcColor]删除SzgcColor结束结果:{}",result);
+        return result;
+    }
+}
+

+ 20 - 8
src/main/java/com/zhaoliangsz/grainsearch/controller/TestTableController.java

@@ -1,6 +1,7 @@
 package com.zhaoliangsz.grainsearch.controller;
 
 
+import cn.hutool.json.JSONObject;
 import org.springframework.web.bind.annotation.RequestMapping;
 import lombok.extern.slf4j.Slf4j;
 import javax.annotation.Resource;
@@ -11,6 +12,9 @@ import com.zhaoliangsz.grainsearch.basic.result.PageResult;
 import com.zhaoliangsz.grainsearch.domain.entity.TestTable;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+
 /**
  * <p>
  *  前端控制器
@@ -29,13 +33,13 @@ public class TestTableController {
      * 获取TestTable
      * @return
      */
-    @GetMapping
-    public PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException {
-        log.info("[TestTableController.queryTestTableList]获取TestTable列表开始参数:{}",queryTestTable);
-        PageResult<TestTable> page = myITestTableService.queryTestTableList(queryTestTable);
-        log.info("[TestTableController.queryTestTableList]获取TestTable列表结束结果:{}",page);
-        return page;
-    }
+//    @GetMapping
+//    public PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException {
+//        log.info("[TestTableController.queryTestTableList]获取TestTable列表开始参数:{}",queryTestTable);
+//        PageResult<TestTable> page = myITestTableService.queryTestTableList(queryTestTable);
+//        log.info("[TestTableController.queryTestTableList]获取TestTable列表结束结果:{}",page);
+//        return page;
+//    }
     /**
      * 新增TestTable
      * @return
@@ -69,7 +73,15 @@ public class TestTableController {
         log.info("[TestTableController.deleteTestTable]删除TestTable结束结果:{}",result);
         return result;
     }
-
+    /**
+     * 查询记录
+     * @return
+     */
+    @GetMapping
+    public TestTable getTableList(TestTable queryTestTable) throws ServiceException {
+        log.info("[TestTableController.queryTestTableList]获取TestTable列表开始参数:{}",queryTestTable);
+        return myITestTableService.getTableList(queryTestTable);
+    }
 
 }
 

+ 51 - 0
src/main/java/com/zhaoliangsz/grainsearch/domain/entity/AskLeave.java

@@ -0,0 +1,51 @@
+package com.zhaoliangsz.grainsearch.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhaoliangsz.grainsearch.basic.constants.DateConstants;
+import java.time.LocalDateTime;
+
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-02-18 10:28:10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("ask_leave")
+public class AskLeave extends BaseDO<AskLeave> {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("personName")
+    private String personName;
+    @TableField("sumAskDays")
+    private String sumAskDays;
+    @TableField("departmentName")
+    private String departmentName;
+    @TableField("startTime")
+    @JsonFormat(pattern = DateConstants.YEAR_MONTH_DAY, timezone = DateConstants.TIMEZONE,shape=JsonFormat.Shape.STRING)
+    private LocalDateTime startTime;
+    @TableField("endTime")
+    @JsonFormat(pattern = DateConstants.YEAR_MONTH_DAY, timezone = DateConstants.TIMEZONE,shape=JsonFormat.Shape.STRING)
+    private LocalDateTime endTime;
+    @TableField("title")
+    private String title;
+    @TableField("askStatus")
+    private String askStatus;
+    @TableField("isover")
+    private String isover;
+
+
+}

+ 53 - 0
src/main/java/com/zhaoliangsz/grainsearch/domain/entity/SzgcColor.java

@@ -0,0 +1,53 @@
+package com.zhaoliangsz.grainsearch.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhaoliangsz.grainsearch.basic.constants.DateConstants;
+import com.zhaoliangsz.grainsearch.domain.entity.BaseDO;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-04-03 13:22:38
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("szgc_color")
+public class SzgcColor extends BaseDO<SzgcColor> {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("id")
+    private String id;
+    @TableField("name")
+    private String name;
+    @TableField("level")
+    private String level;
+    @TableField("color")
+    private String color;
+    @TableField("position")
+    private String position;
+    @TableField("createtime")
+    private String createtime;
+    @TableField("departid")
+    private String departid;
+    @TableField("qyid")
+    private String qyid;
+    @TableField("worktype")
+    private String worktype;
+
+
+}

+ 4 - 1
src/main/java/com/zhaoliangsz/grainsearch/domain/entity/TestTable.java

@@ -110,7 +110,10 @@ public class TestTable extends BaseDO<TestTable> {
 
     @TableField(exist = false)
     private String password;
-
+    @TableField(exist = false)
+    private String recordDate;
+    @TableField(exist = false)
+    private Double inventory;
     @TableField("create_by")
     private String createBy;
     @TableField("create_time")

+ 32 - 0
src/main/java/com/zhaoliangsz/grainsearch/mapper/AskLeaveMapper.java

@@ -0,0 +1,32 @@
+package com.zhaoliangsz.grainsearch.mapper;
+
+import com.zhaoliangsz.grainsearch.domain.entity.AskLeave;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-02-18 10:28:10
+ */
+public interface AskLeaveMapper extends BaseMapper<AskLeave> {
+    /**
+     * 根据条件查询总数
+     *
+     * @param pageView
+     * @return
+     */
+     Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<AskLeave> getListByCondition(Map<String, Object> pageView);
+}

+ 32 - 0
src/main/java/com/zhaoliangsz/grainsearch/mapper/SzgcColorMapper.java

@@ -0,0 +1,32 @@
+package com.zhaoliangsz.grainsearch.mapper;
+
+import com.zhaoliangsz.grainsearch.domain.entity.SzgcColor;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-04-03 13:22:38
+ */
+public interface SzgcColorMapper extends BaseMapper<SzgcColor> {
+    /**
+     * 根据条件查询总数
+     *
+     * @param pageView
+     * @return
+     */
+     Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<SzgcColor> getListByCondition(Map<String, Object> pageView);
+}

+ 2 - 0
src/main/java/com/zhaoliangsz/grainsearch/mapper/TestTableMapper.java

@@ -29,4 +29,6 @@ public interface TestTableMapper extends BaseMapper<TestTable> {
      * @return
      */
     List<TestTable> getListByCondition(Map<String, Object> pageView);
+
+    TestTable getTableListByCondition(Map<String, Object> pageView);
 }

+ 40 - 0
src/main/java/com/zhaoliangsz/grainsearch/service/IAskLeaveService.java

@@ -0,0 +1,40 @@
+package com.zhaoliangsz.grainsearch.service;
+
+import com.zhaoliangsz.grainsearch.domain.entity.AskLeave;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-02-18 10:28:10
+ */
+public interface IAskLeaveService extends IService<AskLeave> {
+    /**
+    * 查询
+    * @return
+    */
+    PageResult<AskLeave> queryAskLeaveList(AskLeave queryAskLeave) throws ServiceException;
+
+    /**
+     * 新增
+     * @return
+     */
+    String addAskLeave(AskLeave addAskLeave) throws ServiceException;
+
+    /**
+     * 编辑
+     * @return
+     */
+    String editAskLeave(AskLeave editAskLeave) throws ServiceException;
+
+    /**
+     * 删除
+     * @return
+     */
+    String deleteAskLeave(AskLeave deleteAskLeave) throws ServiceException;
+
+ }

+ 40 - 0
src/main/java/com/zhaoliangsz/grainsearch/service/ISzgcColorService.java

@@ -0,0 +1,40 @@
+package com.zhaoliangsz.grainsearch.service;
+
+import com.zhaoliangsz.grainsearch.domain.entity.SzgcColor;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-04-03 13:22:38
+ */
+public interface ISzgcColorService extends IService<SzgcColor> {
+    /**
+    * 查询
+    * @return
+    */
+    PageResult<SzgcColor> querySzgcColorList(SzgcColor querySzgcColor) throws ServiceException;
+
+    /**
+     * 新增
+     * @return
+     */
+    String addSzgcColor(SzgcColor addSzgcColor) throws ServiceException;
+
+    /**
+     * 编辑
+     * @return
+     */
+    String editSzgcColor(SzgcColor editSzgcColor) throws ServiceException;
+
+    /**
+     * 删除
+     * @return
+     */
+    String deleteSzgcColor(SzgcColor deleteSzgcColor) throws ServiceException;
+
+ }

+ 9 - 2
src/main/java/com/zhaoliangsz/grainsearch/service/ITestTableService.java

@@ -1,9 +1,14 @@
 package com.zhaoliangsz.grainsearch.service;
 
+import cn.hutool.json.JSONObject;
 import com.zhaoliangsz.grainsearch.domain.entity.TestTable;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
 import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+
 /**
  * <p>
  *  服务类
@@ -17,7 +22,7 @@ public interface ITestTableService extends IService<TestTable> {
     * 查询
     * @return
     */
-    PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException;
+//    PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException;
 
     /**
      * 新增
@@ -37,4 +42,6 @@ public interface ITestTableService extends IService<TestTable> {
      */
     String deleteTestTable(TestTable deleteTestTable) throws ServiceException;
 
- }
+    TestTable getTableList(TestTable queryTestTable);
+
+}

+ 82 - 0
src/main/java/com/zhaoliangsz/grainsearch/service/impl/AskLeaveServiceImpl.java

@@ -0,0 +1,82 @@
+package com.zhaoliangsz.grainsearch.service.impl;
+
+import com.zhaoliangsz.grainsearch.domain.entity.AskLeave;
+import com.zhaoliangsz.grainsearch.mapper.AskLeaveMapper;
+import com.zhaoliangsz.grainsearch.service.IAskLeaveService;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.stereotype.Service;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.springframework.transaction.annotation.Transactional;
+import com.zhaoliangsz.grainsearch.basic.exception.ExceptionDefinition;
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-02-18 10:28:10
+ */
+@Slf4j
+@Service
+public class AskLeaveServiceImpl extends ServiceImpl<AskLeaveMapper, AskLeave> implements IAskLeaveService {
+    @Override
+    public PageResult<AskLeave> queryAskLeaveList(AskLeave queryAskLeave) throws ServiceException{
+        try{
+            Map<String,Object> pageView = new HashMap<>();
+            pageView.put("startRecord",(queryAskLeave.getCurrentPage()-1)
+            *queryAskLeave.getPageSize());
+            pageView.put("pageSize",queryAskLeave.getPageSize());
+            pageView.put("currentPage",queryAskLeave.getCurrentPage());
+            Integer dataCount=baseMapper.getCountByCondition(pageView);
+            List<AskLeave>dataList=baseMapper.getListByCondition(pageView);
+            return new PageResult<>(dataList==null?new ArrayList<>():dataList,dataCount==null?0:dataCount);
+        }
+        catch(Exception ex){
+            log.error("[AskLeaveServiceImpl.queryAskLeaveList]异常:{}",ex.toString());
+            throw new ServiceException(ExceptionDefinition.QUERY_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String addAskLeave(AskLeave addAskLeave) throws ServiceException {
+        boolean flag = this.save(addAskLeave);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.ADD_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editAskLeave(AskLeave editAskLeave) throws ServiceException {
+        boolean flag = this.updateById(editAskLeave);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.EDIT_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String deleteAskLeave(AskLeave deleteAskLeave) throws ServiceException {
+        boolean flag = this.removeById(deleteAskLeave);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.DELETE_DATA_EXCEPTION);
+        }
+    }
+}

+ 82 - 0
src/main/java/com/zhaoliangsz/grainsearch/service/impl/SzgcColorServiceImpl.java

@@ -0,0 +1,82 @@
+package com.zhaoliangsz.grainsearch.service.impl;
+
+import com.zhaoliangsz.grainsearch.domain.entity.SzgcColor;
+import com.zhaoliangsz.grainsearch.mapper.SzgcColorMapper;
+import com.zhaoliangsz.grainsearch.service.ISzgcColorService;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.stereotype.Service;
+import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
+import com.zhaoliangsz.grainsearch.basic.result.PageResult;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.springframework.transaction.annotation.Transactional;
+import com.zhaoliangsz.grainsearch.basic.exception.ExceptionDefinition;
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zyw
+ * @since 2024-04-03 13:22:38
+ */
+@Slf4j
+@Service
+public class SzgcColorServiceImpl extends ServiceImpl<SzgcColorMapper, SzgcColor> implements ISzgcColorService {
+    @Override
+    public PageResult<SzgcColor> querySzgcColorList(SzgcColor querySzgcColor) throws ServiceException{
+        try{
+            Map<String,Object> pageView = new HashMap<>();
+            pageView.put("startRecord",(querySzgcColor.getCurrentPage()-1)
+            *querySzgcColor.getPageSize());
+            pageView.put("pageSize",querySzgcColor.getPageSize());
+            pageView.put("currentPage",querySzgcColor.getCurrentPage());
+            Integer dataCount=baseMapper.getCountByCondition(pageView);
+            List<SzgcColor>dataList=baseMapper.getListByCondition(pageView);
+            return new PageResult<>(dataList==null?new ArrayList<>():dataList,dataCount==null?0:dataCount);
+        }
+        catch(Exception ex){
+            log.error("[SzgcColorServiceImpl.querySzgcColorList]异常:{}",ex.toString());
+            throw new ServiceException(ExceptionDefinition.QUERY_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String addSzgcColor(SzgcColor addSzgcColor) throws ServiceException {
+        boolean flag = this.save(addSzgcColor);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.ADD_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editSzgcColor(SzgcColor editSzgcColor) throws ServiceException {
+        boolean flag = this.updateById(editSzgcColor);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.EDIT_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String deleteSzgcColor(SzgcColor deleteSzgcColor) throws ServiceException {
+        boolean flag = this.removeById(deleteSzgcColor);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.DELETE_DATA_EXCEPTION);
+        }
+    }
+}

+ 281 - 28
src/main/java/com/zhaoliangsz/grainsearch/service/impl/TestTableServiceImpl.java

@@ -1,26 +1,56 @@
 package com.zhaoliangsz.grainsearch.service.impl;
 
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.zhaoliangsz.grainsearch.domain.entity.AskLeave;
 import com.zhaoliangsz.grainsearch.domain.entity.InventoryTable;
+import com.zhaoliangsz.grainsearch.domain.entity.SzgcColor;
 import com.zhaoliangsz.grainsearch.domain.entity.TestTable;
+import com.zhaoliangsz.grainsearch.mapper.AskLeaveMapper;
 import com.zhaoliangsz.grainsearch.mapper.InventoryTableMapper;
+import com.zhaoliangsz.grainsearch.mapper.SzgcColorMapper;
 import com.zhaoliangsz.grainsearch.mapper.TestTableMapper;
 import com.zhaoliangsz.grainsearch.service.ITestTableService;
-import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import com.zhaoliangsz.grainsearch.basic.exception.ServiceException;
-import com.zhaoliangsz.grainsearch.basic.result.PageResult;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 
-import java.sql.Wrapper;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 import org.springframework.transaction.annotation.Transactional;
 import com.zhaoliangsz.grainsearch.basic.exception.ExceptionDefinition;
+
 /**
  * <p>
  *  服务实现类
@@ -36,23 +66,27 @@ public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable
     private TestTableMapper testTableMapper;
     @Autowired
     private InventoryTableMapper inventoryTableMapper;
-    @Override
-    public PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException{
-        try{
-            Map<String,Object>pageView=new HashMap<>();
-            pageView.put("startRecord",(queryTestTable.getCurrentPage()-1)
-            *queryTestTable.getPageSize());
-            pageView.put("pageSize",queryTestTable.getPageSize());
-            pageView.put("currentPage",queryTestTable.getCurrentPage());
-            Integer dataCount=baseMapper.getCountByCondition(pageView);
-            List<TestTable>dataList=baseMapper.getListByCondition(pageView);
-            return new PageResult<>(dataList==null?new ArrayList<>():dataList,dataCount==null?0:dataCount);
-        }
-        catch(Exception ex){
-            log.error("[TestTableServiceImpl.queryTestTableList]异常:{}",ex.toString());
-            throw new ServiceException(ExceptionDefinition.QUERY_DATA_EXCEPTION);
-        }
-    }
+    @Autowired
+    private AskLeaveMapper askLeaveMapper;
+    @Autowired
+    private SzgcColorMapper szgcColorMapper;
+//    @Override
+//    public PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException{
+//        try{
+//            Map<String,Object>pageView=new HashMap<>();
+//            pageView.put("startRecord",(queryTestTable.getCurrentPage()-1)
+//            *queryTestTable.getPageSize());
+//            pageView.put("pageSize",queryTestTable.getPageSize());
+//            pageView.put("currentPage",queryTestTable.getCurrentPage());
+//            Integer dataCount=baseMapper.getCountByCondition(pageView);
+//            List<TestTable>dataList=baseMapper.getListByCondition(pageView);
+//            return new PageResult<>(dataList==null?new ArrayList<>():dataList,dataCount==null?0:dataCount);
+//        }
+//        catch(Exception ex){
+//            log.error("[TestTableServiceImpl.queryTestTableList]异常:{}",ex.toString());
+//            throw new ServiceException(ExceptionDefinition.QUERY_DATA_EXCEPTION);
+//        }
+//    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -191,14 +225,233 @@ public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable
         }
     }
 
+    @Override
+    public TestTable getTableList(TestTable queryTestTable) {
+        Map<String,Object>pageView=new HashMap<>();
+        pageView.put("date",queryTestTable.getRecordDate());
+        TestTable testTable=baseMapper.getTableListByCondition(pageView);
+        return testTable;
+
+    }
+
     /**
-     * 每天23.55点更新(新)
+     * 每天7.55点更新(新) 考勤请假信息取数
      */
-//    @Transactional(rollbackFor = Exception.class)
-//    @Scheduled(cron = "0 55 23 * * ?")
-//    public String addInfo() {
-//        if ("3".equals(ENV)) {
-//        }
-//        return "OK";
-//    }
+    @Transactional(rollbackFor = Exception.class)
+    @Scheduled(cron = "0 55 07 * * ?")
+    public String callFixedApi() throws URISyntaxException, UnsupportedEncodingException, SQLException {
+        String resultString = "";
+        Date date = new Date();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String today = dateFormat.format(date);
+        Calendar cal = Calendar.getInstance();
+        cal.add(Calendar.DAY_OF_MONTH, -10);
+        Date date1 = cal.getTime();
+        String yesterday = dateFormat.format(date1);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("currentPage","1");
+        jsonObject.put("pageSize","1000");
+        jsonObject.put("startTimes",yesterday);
+        jsonObject.put("endTime",today);
+       // 将JSONObject转换为JSON字符串
+        String jsonString = jsonObject.toString();
+        HashMap<String, String> map =new HashMap<>();
+        map.put("corpId","wwd6fc036111f244df");
+        map.put("data", jsonString);
+        CloseableHttpClient client = null;
+        CloseableHttpResponse response = null;
+        RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(550000).setConnectTimeout(550000)
+                .setConnectionRequestTimeout(550000).setStaleConnectionCheckEnabled(true).build();
+        client = HttpClients.custom().setDefaultRequestConfig(defaultRequestConfig).build();
+        URIBuilder uriBuilder = new URIBuilder("http://m.cofcotunhe.com:8090/wxqyh/api/askAction!getAskList.action");
+
+        HttpPost httpPost = new HttpPost(uriBuilder.build());
+        httpPost.setHeader("Connection", "Keep-Alive");
+        httpPost.setHeader("Charset", "UTF-8");
+        httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
+        Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+
+        while (it.hasNext()) {
+            Map.Entry<String, String> entry = it.next();
+            NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue());
+            params.add(pair);
+        }
+
+        httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
+        try {
+            response = client.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+            //将JSON字符串转为JSON对象
+            JSONObject jsonObject1 = JSONObject.parseObject(resultString);
+            String data = jsonObject1.getString("data");
+            JSONObject jsonObjects= JSONObject.parseObject(data);
+            JSONArray pageData = jsonObjects.getJSONArray("pageData");
+
+
+
+            // 数据库连接信息
+            String url = "jdbc:mysql://10.23.250.88:3306/dt";
+            String user = "admin";
+            String password = "14789632";
+            Connection conn = null;
+            Statement stmt = null;
+            try {
+                // 注册JDBC驱动
+                Class.forName("com.mysql.cj.jdbc.Driver");
+                // 打开连接
+                conn = DriverManager.getConnection(url, user, password);
+                // 执行SQL语句
+                stmt = conn.createStatement();
+                String sql = "DELETE FROM " + "ask_leave";
+                stmt.executeUpdate(sql);
+                System.out.println("表数据删除成功!");
+            } catch (ClassNotFoundException e) {
+                System.out.println("JDBC驱动未找到!");
+            } catch (SQLException e) {
+                System.out.println("SQL执行出错:" + e.getMessage());
+            } finally {
+                // 关闭资源
+                try {
+                    if (stmt != null) stmt.close();
+                    if (conn != null) conn.close();
+                } catch (SQLException e) {
+                    System.out.println("资源关闭出错:" + e.getMessage());
+                }
+            }
+
+
+
+            for (int i = 0; i < pageData.size(); i++) {
+                JSONObject qingjia = pageData.getJSONObject(i);
+                String askStatus = qingjia.getString("askStatus");
+                String isover = qingjia.getString("isover");
+                String departmentName = qingjia.getString("departmentName");
+                String personName = qingjia.getString("personName");
+                String title = qingjia.getString("title");
+                String sumAskDays = qingjia.getString("sumAskDays");
+                String startTime=qingjia.getString("startTime");
+                String endTime=qingjia.getString("endTime");
+                //辽糖审批通过
+                if ("2".equals(askStatus)&&"1".equals(isover)&&departmentName.contains("中粮糖业辽宁有限公司")){
+                    AskLeave askLeave=new AskLeave();
+                    askLeave.setDepartmentName(departmentName);
+                    askLeave.setTitle(title);
+                    askLeave.setPersonName(personName);
+                    askLeave.setSumAskDays(sumAskDays);
+                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                    LocalDateTime localDateTime = LocalDateTime.parse(startTime, formatter);
+                    LocalDateTime localDateTime1 = LocalDateTime.parse(endTime, formatter);
+                    askLeave.setStartTime(localDateTime);
+                    askLeave.setEndTime(localDateTime1);
+                    askLeave.setAskStatus(askStatus);
+                    askLeave.setIsover(isover);
+                    askLeaveMapper.insert(askLeave);
+
+                }
+
+            }
+
+        } catch (ClientProtocolException e) {
+            throw new RuntimeException("创建连接失败" + e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return "ok";
+    }
+    /**
+     * 每天8点更新(新)  数字工厂四色图取数
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Scheduled(cron = "0 00 08 * * ?")
+    public void szgcApi() {
+        JSONObject jsonParams = new JSONObject();
+        jsonParams.put("qxid","c2c66c0a-5526-47da-bd3e-f25f745e8a82");
+        jsonParams.put("departid","c2c66c0a-5526-47da-bd3e-f25f745e8a82");
+
+        HttpClient httpClient = HttpClients.createDefault();
+        HttpPost httpPost = new HttpPost("http://safety.cofcotunhe.com/api/user/workUnit/getWorkUnitListBydepartIdPagination");
+
+        try {
+            StringEntity entity = new StringEntity(jsonParams.toString());
+            entity.setContentType("application/json");
+            httpPost.setEntity(entity);
+
+            HttpResponse response = httpClient.execute(httpPost);
+            String responseString = EntityUtils.toString(response.getEntity());
+            //将JSON字符串转为JSON对象
+            JSONObject jsonObject1 = JSONObject.parseObject(responseString);
+            String data = jsonObject1.getString("data");
+            JSONObject jsonObjects= JSONObject.parseObject(data);
+            JSONArray pageData = jsonObjects.getJSONArray("rows");
+            // 数据库连接信息
+            String url = "jdbc:mysql://10.23.250.88:3306/dt";
+            String user = "admin";
+            String password = "14789632";
+            Connection conn = null;
+            Statement stmt = null;
+            try {
+                // 注册JDBC驱动
+                Class.forName("com.mysql.cj.jdbc.Driver");
+                // 打开连接
+                conn = DriverManager.getConnection(url, user, password);
+                // 执行SQL语句
+                stmt = conn.createStatement();
+                String sql = "DELETE FROM " + "szgc_color";
+                stmt.executeUpdate(sql);
+                System.out.println("表数据删除成功!");
+            } catch (ClassNotFoundException e) {
+                System.out.println("JDBC驱动未找到!");
+            } catch (SQLException e) {
+                System.out.println("SQL执行出错:" + e.getMessage());
+            } finally {
+                // 关闭资源
+                try {
+                    if (stmt != null) stmt.close();
+                    if (conn != null) conn.close();
+                } catch (SQLException e) {
+                    System.out.println("资源关闭出错:" + e.getMessage());
+                }
+            }
+
+
+
+            for (int i = 0; i < pageData.size(); i++) {
+                JSONObject colorData = pageData.getJSONObject(i);
+                String id = colorData.getString("id");
+                String name = colorData.getString("name");
+                String level = colorData.getString("level");
+                String color = colorData.getString("color");
+                String position = colorData.getString("position");
+                String createtime = colorData.getString("createtime");
+                String departid=colorData.getString("departid");
+                String qyid=colorData.getString("qyid");
+                String worktype=colorData.getString("worktype");
+
+                SzgcColor szgcColor=new SzgcColor();
+                szgcColor.setId(id);
+                szgcColor.setName(name);
+                szgcColor.setLevel(level);
+                szgcColor.setColor(color);
+                szgcColor.setPosition(position);
+                szgcColor.setCreatetime(createtime);
+                szgcColor.setDepartid(departid);
+                szgcColor.setQyid(qyid);
+                szgcColor.setWorktype(worktype);
+                szgcColorMapper.insert(szgcColor);
+
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+
+
+
+    }
+
+
+
 }

+ 39 - 0
src/main/resources/mapper/AskLeaveMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhaoliangsz.grainsearch.mapper.AskLeaveMapper">
+
+
+        <!-- 通用查询映射结果 -->
+        <resultMap id="BaseResultMap" type="com.zhaoliangsz.grainsearch.domain.entity.AskLeave">
+                    <result column="personName" property="personName" />
+                    <result column="sumAskDays" property="sumAskDays" />
+                    <result column="departmentName" property="departmentName" />
+                    <result column="startTime" property="startTime" />
+                    <result column="endTime" property="endTime" />
+                    <result column="title" property="title" />
+        </resultMap>
+
+        <!-- 通用查询结果列 -->
+        <sql id="Base_Column_List">
+                personName, sumAskDays, departmentName, startTime, endTime, title
+        </sql>
+
+
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(1)
+        FROM ask_leave
+        WHERE has_deleted = '0'
+    </select>
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.zhaoliangsz.grainsearch.domain.entity.AskLeave">
+        SELECT
+        *
+        FROM ask_leave
+        WHERE has_deleted = '0'
+        ORDER BY update_time DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>

+ 42 - 0
src/main/resources/mapper/SzgcColorMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhaoliangsz.grainsearch.mapper.SzgcColorMapper">
+
+
+        <!-- 通用查询映射结果 -->
+        <resultMap id="BaseResultMap" type="com.zhaoliangsz.grainsearch.domain.entity.SzgcColor">
+                    <id column="id" property="id" />
+                    <result column="name" property="name" />
+                    <result column="level" property="level" />
+                    <result column="color" property="color" />
+                    <result column="position" property="position" />
+                    <result column="createtime" property="createtime" />
+                    <result column="departid" property="departid" />
+                    <result column="qyid" property="qyid" />
+                    <result column="worktype" property="worktype" />
+        </resultMap>
+
+        <!-- 通用查询结果列 -->
+        <sql id="Base_Column_List">
+                id, name, level, color, position, createtime, departid, qyid, worktype
+        </sql>
+
+
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(1)
+        FROM szgc_color
+        WHERE has_deleted = '0'
+    </select>
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.zhaoliangsz.grainsearch.domain.entity.SzgcColor">
+        SELECT
+        *
+        FROM szgc_color
+        WHERE has_deleted = '0'
+        ORDER BY update_time DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>

+ 20 - 0
src/main/resources/mapper/TestTableMapper.xml

@@ -38,4 +38,24 @@
             LIMIT ${startRecord}, ${pageSize}
         </if>
     </select>
+    <select id="getTableListByCondition" parameterType="Map"
+            resultType="com.zhaoliangsz.grainsearch.domain.entity.TestTable">
+        SELECT
+            tt.date AS date,
+            SUM( tt.filed1 ) AS filed1,
+            SUM( tt.filed2 ) AS filed2,
+            SUM( tt.filed3 ) AS filed3,
+            SUM( tt.filed4 ) AS filed4,
+            SUM( tt.filed5 ) AS filed5,
+            SUM( tt.filed6 ) AS filed6,
+            SUM( tt.total ) AS total,
+            SUM( tt.in_num ) AS inNum,
+            it.inventory AS inventory
+        FROM
+            test_table tt
+            LEFT JOIN inventory_table it ON it.date = tt.date
+        WHERE
+          DATE_FORMAT(tt.date ,"%Y%m%d") =
+            DATE_FORMAT(#{date},"%Y%m%d")
+    </select>
 </mapper>