zyw 1 år sedan
förälder
incheckning
04bc38c3b7
21 ändrade filer med 384 tillägg och 28 borttagningar
  1. 5 5
      src/main/java/com/zhaoliangsz/grainsearch/CodeGenerator.java
  2. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/advice/ExceptionAdvice.java
  3. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/advice/ResponseAdvice.java
  4. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/config/MyWebMVCConfig.java
  5. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/config/MybatisPlusConfig.java
  6. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/config/WebConfig.java
  7. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/interceptor/LoginInterceptor.java
  8. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/result/PageResult.java
  9. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/basic/util/QRCodeUtil.java
  10. 73 0
      src/main/java/com/zhaoliangsz/grainsearch/controller/InventoryTableController.java
  11. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/controller/TestTableController.java
  12. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/BaseDO.java
  13. 55 0
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/InventoryTable.java
  14. 4 5
      src/main/java/com/zhaoliangsz/grainsearch/domain/entity/TestTable.java
  15. 32 0
      src/main/java/com/zhaoliangsz/grainsearch/mapper/InventoryTableMapper.java
  16. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/mapper/TestTableMapper.java
  17. 40 0
      src/main/java/com/zhaoliangsz/grainsearch/service/IInventoryTableService.java
  18. 1 1
      src/main/java/com/zhaoliangsz/grainsearch/service/ITestTableService.java
  19. 82 0
      src/main/java/com/zhaoliangsz/grainsearch/service/impl/InventoryTableServiceImpl.java
  20. 38 6
      src/main/java/com/zhaoliangsz/grainsearch/service/impl/TestTableServiceImpl.java
  21. 43 0
      src/main/resources/mapper/InventoryTableMapper.xml

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

@@ -26,22 +26,22 @@ public class CodeGenerator {
     /**
      * 数据库链接地址
      */
-    private static final String URL = "jdbc:mysql://127.0.0.1:3306/grain_search?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/h5?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=UTC";
 
     /**
      * 用户名
      */
-    private static final String USERNAME = "root";
+    private static final String USERNAME = "admin";
 
     /**
      * 密码
      */
-    private static final String PASSWORD = "123456";
+    private static final String PASSWORD = "14789632";
 
     /**
      * 作者
      */
-    private static final String AUTHOR = "chengchangjiang";
+    private static final String AUTHOR = "zyw";
 
     /**
      * 表名的前缀,从表生成代码时会去掉前缀
@@ -56,7 +56,7 @@ public class CodeGenerator {
     /**
      * 需要生成的表名,必填
      */
-    private static final List<String> TABLES = ListUtil.toList();
+    private static final List<String> TABLES = ListUtil.toList("test","inventory_table");
 
 
     public static void main(String[] args) {

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/advice/ExceptionAdvice.java

@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;
 import java.util.HashMap;
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 17:16
  * @description:
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/advice/ResponseAdvice.java

@@ -15,7 +15,7 @@ import javax.annotation.Resource;
 import java.util.HashMap;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 17:18
  * @description:
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/config/MyWebMVCConfig.java

@@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 17:08
  * @description:
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/config/MybatisPlusConfig.java

@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
 import java.util.Date;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 15:33
  * @description: MybatisPlus配置类
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/config/WebConfig.java

@@ -18,7 +18,7 @@ import java.io.IOException;
 import java.util.List;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 16:56
  * @description:
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/interceptor/LoginInterceptor.java

@@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 17:01
  * @description: 登录鉴权校验
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/result/PageResult.java

@@ -8,7 +8,7 @@ import java.io.Serializable;
 import java.util.List;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/18 11:03
  * @description:
  */

+ 1 - 1
src/main/java/com/zhaoliangsz/grainsearch/basic/util/QRCodeUtil.java

@@ -19,7 +19,7 @@ import java.nio.file.Path;
 import java.util.Hashtable;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/18 9:10
  * @description: 二维码Util类
  */

+ 73 - 0
src/main/java/com/zhaoliangsz/grainsearch/controller/InventoryTableController.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.IInventoryTableService;
+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.InventoryTable;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author zyw
+ * @since 2023-09-27 10:12:06
+ */
+@RestController
+@Slf4j
+@RequestMapping("/v1/inventoryTable")
+public class InventoryTableController {
+    @Resource
+    private IInventoryTableService myIInventoryTableService;
+    /**
+     * 获取InventoryTable
+     * @return
+     */
+    @GetMapping
+    public PageResult<InventoryTable> queryInventoryTableList(InventoryTable queryInventoryTable) throws ServiceException {
+        log.info("[InventoryTableController.queryInventoryTableList]获取InventoryTable列表开始参数:{}",queryInventoryTable);
+        PageResult<InventoryTable> page = myIInventoryTableService.queryInventoryTableList(queryInventoryTable);
+        log.info("[InventoryTableController.queryInventoryTableList]获取InventoryTable列表结束结果:{}",page);
+        return page;
+    }
+    /**
+     * 新增InventoryTable
+     * @return
+     */
+    @PostMapping
+    public String addInventoryTable(@RequestBody InventoryTable addInventoryTable) throws ServiceException {
+        log.info("[InventoryTableController.addInventoryTable]新增InventoryTable开始addInventoryTable:{}",addInventoryTable);
+        String result = myIInventoryTableService.addInventoryTable(addInventoryTable);
+        log.info("[InventoryTableController.addInventoryTable]新增InventoryTable结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 编辑InventoryTable
+     * @return
+     */
+    @PutMapping
+    public String editInventoryTable(@RequestBody InventoryTable editInventoryTable) throws ServiceException {
+        log.info("[InventoryTableController.editInventoryTable]编辑InventoryTable开始参数:{}",editInventoryTable);
+        String result = myIInventoryTableService.editInventoryTable(editInventoryTable);
+        log.info("[InventoryTableController.editInventoryTable]编辑InventoryTable结束结果:{}",result);
+        return result;
+    }
+    /**
+     * 删除InventoryTable
+     * @return
+     */
+    @DeleteMapping
+    public String deleteInventoryTable(@RequestBody InventoryTable deleteInventoryTable) throws ServiceException {
+        log.info("[InventoryTableController.deleteInventoryTable]删除InventoryTable开始参数:{}",deleteInventoryTable);
+        String result = myIInventoryTableService.deleteInventoryTable(deleteInventoryTable);
+        log.info("[InventoryTableController.deleteInventoryTable]删除InventoryTable结束结果:{}",result);
+        return result;
+    }
+}
+

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

@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
  *  前端控制器
  * </p>
  *
- * @author chengchangjiang
+ * @author zyw
  * @since 2023-08-21 14:40:08
  */
 @RestController

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

@@ -1,7 +1,7 @@
 package com.zhaoliangsz.grainsearch.domain.entity;
 
 /**
- * @author : chengchangjiang
+ * @author : zyw
  * @date : 2023/8/17 12:06
  * @description:基础类DO
  */

+ 55 - 0
src/main/java/com/zhaoliangsz/grainsearch/domain/entity/InventoryTable.java

@@ -0,0 +1,55 @@
+package com.zhaoliangsz.grainsearch.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+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 2023-09-27 10:12:06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("inventory_table")
+public class InventoryTable extends BaseDO<InventoryTable> {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("id")
+    private Long id;
+    @TableField("date")
+    private LocalDateTime date;
+    @TableField("out_num")
+    private Object outNum;
+    @TableField("in_num")
+    private Object inNum;
+    @TableField("inventory")
+    private Object inventory;
+    @TableField("create_by")
+    private String createBy;
+    @TableField("create_time")
+    private LocalDateTime createTime;
+    @TableField("update_by")
+    private String updateBy;
+    @TableField("update_time")
+    private LocalDateTime updateTime;
+    @TableField("has_deleted")
+    @TableLogic
+    private Integer hasDeleted;
+
+
+}

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

@@ -7,10 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
 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.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Date;
 
 
 import lombok.Data;
@@ -22,7 +21,7 @@ import lombok.experimental.Accessors;
  * 
  * </p>
  *
- * @author chengchangjiang
+ * @author zyw
  * @since 2023-08-21 14:40:08
  */
 @Data
@@ -110,11 +109,11 @@ public class TestTable extends BaseDO<TestTable> {
     @TableField("create_by")
     private String createBy;
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private Date createTime;
     @TableField("update_by")
     private String updateBy;
     @TableField("update_time")
-    private LocalDateTime updateTime;
+    private Date updateTime;
     @TableField("has_deleted")
     @TableLogic
     private Integer hasDeleted;

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

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

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

@@ -10,7 +10,7 @@ import java.util.Map;
  *  Mapper 接口
  * </p>
  *
- * @author chengchangjiang
+ * @author zyw
  * @since 2023-08-21 14:40:08
  */
 public interface TestTableMapper extends BaseMapper<TestTable> {

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

@@ -0,0 +1,40 @@
+package com.zhaoliangsz.grainsearch.service;
+
+import com.zhaoliangsz.grainsearch.domain.entity.InventoryTable;
+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 2023-09-27 10:12:06
+ */
+public interface IInventoryTableService extends IService<InventoryTable> {
+    /**
+    * 查询
+    * @return
+    */
+    PageResult<InventoryTable> queryInventoryTableList(InventoryTable queryInventoryTable) throws ServiceException;
+
+    /**
+     * 新增
+     * @return
+     */
+    String addInventoryTable(InventoryTable addInventoryTable) throws ServiceException;
+
+    /**
+     * 编辑
+     * @return
+     */
+    String editInventoryTable(InventoryTable editInventoryTable) throws ServiceException;
+
+    /**
+     * 删除
+     * @return
+     */
+    String deleteInventoryTable(InventoryTable deleteInventoryTable) throws ServiceException;
+
+ }

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

@@ -9,7 +9,7 @@ import com.zhaoliangsz.grainsearch.basic.result.PageResult;
  *  服务类
  * </p>
  *
- * @author chengchangjiang
+ * @author zyw
  * @since 2023-08-21 14:40:08
  */
 public interface ITestTableService extends IService<TestTable> {

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

@@ -0,0 +1,82 @@
+package com.zhaoliangsz.grainsearch.service.impl;
+
+import com.zhaoliangsz.grainsearch.domain.entity.InventoryTable;
+import com.zhaoliangsz.grainsearch.mapper.InventoryTableMapper;
+import com.zhaoliangsz.grainsearch.service.IInventoryTableService;
+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 2023-09-27 10:12:06
+ */
+@Slf4j
+@Service
+public class InventoryTableServiceImpl extends ServiceImpl<InventoryTableMapper, InventoryTable> implements IInventoryTableService {
+    @Override
+    public PageResult<InventoryTable> queryInventoryTableList(InventoryTable queryInventoryTable) throws ServiceException{
+        try{
+            Map<String,Object> pageView = new HashMap<>();
+            pageView.put("startRecord",(queryInventoryTable.getCurrentPage()-1)
+            *queryInventoryTable.getPageSize());
+            pageView.put("pageSize",queryInventoryTable.getPageSize());
+            pageView.put("currentPage",queryInventoryTable.getCurrentPage());
+            Integer dataCount=baseMapper.getCountByCondition(pageView);
+            List<InventoryTable>dataList=baseMapper.getListByCondition(pageView);
+            return new PageResult<>(dataList==null?new ArrayList<>():dataList,dataCount==null?0:dataCount);
+        }
+        catch(Exception ex){
+            log.error("[InventoryTableServiceImpl.queryInventoryTableList]异常:{}",ex.toString());
+            throw new ServiceException(ExceptionDefinition.QUERY_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String addInventoryTable(InventoryTable addInventoryTable) throws ServiceException {
+        boolean flag = this.save(addInventoryTable);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.ADD_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String editInventoryTable(InventoryTable editInventoryTable) throws ServiceException {
+        boolean flag = this.updateById(editInventoryTable);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.EDIT_DATA_EXCEPTION);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String deleteInventoryTable(InventoryTable deleteInventoryTable) throws ServiceException {
+        boolean flag = this.removeById(deleteInventoryTable);
+        if(flag){
+            return "ok";
+        }
+        else{
+            throw new ServiceException(ExceptionDefinition.DELETE_DATA_EXCEPTION);
+        }
+    }
+}

+ 38 - 6
src/main/java/com/zhaoliangsz/grainsearch/service/impl/TestTableServiceImpl.java

@@ -1,18 +1,21 @@
 package com.zhaoliangsz.grainsearch.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.zhaoliangsz.grainsearch.domain.entity.TestTable;
 import com.zhaoliangsz.grainsearch.mapper.TestTableMapper;
 import com.zhaoliangsz.grainsearch.service.ITestTableService;
 import com.baomidou.mybatisplus.extension.service.IService;
+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.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+
+import java.sql.Wrapper;
+import java.util.*;
+
 import org.springframework.transaction.annotation.Transactional;
 import com.zhaoliangsz.grainsearch.basic.exception.ExceptionDefinition;
 /**
@@ -20,12 +23,14 @@ import com.zhaoliangsz.grainsearch.basic.exception.ExceptionDefinition;
  *  服务实现类
  * </p>
  *
- * @author chengchangjiang
+ * @author zyw
  * @since 2023-08-21 14:40:08
  */
 @Slf4j
 @Service
 public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable> implements ITestTableService {
+    @Autowired
+    private TestTableMapper testTableMapper;
     @Override
     public PageResult<TestTable> queryTestTableList(TestTable queryTestTable) throws ServiceException{
         try{
@@ -47,7 +52,23 @@ public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String addTestTable(TestTable addTestTable) throws ServiceException {
-        boolean flag = this.save(addTestTable);
+        TestTable testTable=testTableMapper.selectOne(new QueryWrapper<TestTable>()
+                 .eq("type",addTestTable.getType())
+                 .eq("banci",addTestTable.getBanci())
+                 .eq("banzu",addTestTable.getBanzu())
+                 .eq("date",addTestTable.getDate()));
+        boolean flag;
+        if (testTable!=null){
+            addTestTable.setUpdateTime(new Date());
+            addTestTable.setId(testTable.getId());
+            flag= this.updateById(addTestTable);
+        }
+        else {
+            addTestTable.setCreateTime(new Date());
+            addTestTable.setUpdateTime(new Date());
+            flag= this.save(addTestTable);
+        }
+
         if(flag){
             return "ok";
         }
@@ -79,4 +100,15 @@ public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable
             throw new ServiceException(ExceptionDefinition.DELETE_DATA_EXCEPTION);
         }
     }
+
+    /**
+     * 每天23.55点更新(新)
+     */
+//    @Transactional(rollbackFor = Exception.class)
+//    @Scheduled(cron = "0 55 23 * * ?")
+//    public String addInfo() {
+//        if ("3".equals(ENV)) {
+//        }
+//        return "OK";
+//    }
 }

+ 43 - 0
src/main/resources/mapper/InventoryTableMapper.xml

@@ -0,0 +1,43 @@
+<?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.InventoryTableMapper">
+
+
+        <!-- 通用查询映射结果 -->
+        <resultMap id="BaseResultMap" type="com.zhaoliangsz.grainsearch.domain.entity.InventoryTable">
+                    <id column="id" property="id" />
+                    <result column="date" property="date" />
+                    <result column="out_num" property="outNum" />
+                    <result column="in_num" property="inNum" />
+                    <result column="inventory" property="inventory" />
+                    <result column="create_by" property="createBy" />
+                    <result column="create_time" property="createTime" />
+                    <result column="update_by" property="updateBy" />
+                    <result column="update_time" property="updateTime" />
+                    <result column="has_deleted" property="hasDeleted" />
+        </resultMap>
+
+        <!-- 通用查询结果列 -->
+        <sql id="Base_Column_List">
+                id, date, out_num, in_num, inventory, create_by, create_time, update_by, update_time, has_deleted
+        </sql>
+
+
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(1)
+        FROM inventory_table
+        WHERE has_deleted = '0'
+    </select>
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.zhaoliangsz.grainsearch.domain.entity.InventoryTable">
+        SELECT
+        *
+        FROM inventory_table
+        WHERE has_deleted = '0'
+        ORDER BY update_time DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>