yaowanxin
2 天以前 d3d6287a3222b9c85a56e4c55c35350c4233c7db
库存管理简练
已修改6个文件
已重命名4个文件
已添加9个文件
545 ■■■■ 文件已修改
src/main/java/com/ruoyi/inventory/controller/StockInController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockManagementController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockOutController.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/domain/StockIn.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockProductMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockInService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockManagementService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/StockOutService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockInServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockManagementServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/service/impl/StockOutServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/controller/SysPostController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockInMapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockManagementMapper.xml 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockOutMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/inventory/StockProductMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/controller/StockInController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
package com.ruoyi.inventory.controller;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.mapper.StockProductMapper;
import com.ruoyi.inventory.service.StockInService;
import com.ruoyi.inventory.domain.StockIn;
import com.ruoyi.project.system.domain.SysPost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
@RequestMapping("/stockin")
public class StockInController extends BaseController {
    @Autowired
    private StockInService stockInService;
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @PostMapping("/add")// æ–°å¢žå…¥åº“记录
    public AjaxResult addStockIn(@RequestBody StockIn stockIn) {
        int i = stockInService.addStockIn(stockIn);
        if(i>0){
            return success();
        }
        return error();
    }
    @GetMapping("/list")// åˆ—出所有入库记录
    public AjaxResult listStockIns() {
        List<StockIn> stockIns = stockInService.listStockIns();
        return success(stockIns);
    }
    @GetMapping("/{id}")// æ ¹æ®ID获取入库记录
    public AjaxResult getStockInById(@PathVariable Long id) {
        StockIn stockIn = stockInService.getStockInById(id);
        return success(stockIn);
    }
    @PutMapping("/update")// æ›´æ–°å…¥åº“记录
    public AjaxResult updateStockIn(@RequestBody StockIn stockIn) {
        int i = stockInService.updateStockIn(stockIn);
        if(i>0){
            return success();
        }
        return error();
    }
    @DeleteMapping("/delete/{id}")// åˆ é™¤å…¥åº“记录
    public AjaxResult deleteStockIn(@PathVariable Long id) {
        int i = stockInService.deleteStockIn(id);
        if(i>0){
            return success();
        }
        return error();
    }
//    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
//    @PreAuthorize("@ss.hasPermi('system:post:export')")
    @GetMapping("/export")// å¯¼å‡ºå…¥åº“数据
    public AjaxResult exportStockInData() {
        List<StockIn> stockIns = stockInService.listStockIns();
        ExcelUtil<StockIn> util = new ExcelUtil<StockIn>(StockIn.class);
        util.exportExcel(stockIns, "库存入库信息");
        return success();
    }
}
src/main/java/com/ruoyi/inventory/controller/StockManagementController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
package com.ruoyi.inventory.controller;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.inventory.service.StockManagementService;
import inventory.domain.StockManagement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.ruoyi.framework.web.domain.AjaxResult.error;
import static com.ruoyi.framework.web.domain.AjaxResult.success;
@RestController
@RequestMapping("/stockmanagement")
public class StockManagementController {
    @Autowired
    private StockManagementService stockManagementService;
    @RequestMapping("/list")// åˆ—出所有出库记录
    public AjaxResult listStockOuts() {
        List<StockManagement> stockManagements = stockManagementService.getStockManagements();
        return success(stockManagements);
    }
    @GetMapping("/{id}")// æ ¹æ®ID获取出库记录
    public AjaxResult getStockOutById(@PathVariable Long id) {
        StockManagement stockManagement = stockManagementService.getStockManagementById(id);
        return success(stockManagement);
    }
    @PostMapping("add")// æ–°å¢žå‡ºåº“记录
    public AjaxResult addStockOut(@RequestBody StockManagement stockManagement) {
        int i = stockManagementService.addStockManagement(stockManagement);
        if(i>0){
            return success();
        }
        return error();
    }
    @PutMapping("/update")// æ›´æ–°å‡ºåº“记录
    public AjaxResult updateStockOut(@RequestBody StockManagement stockManagement) {
        int i = stockManagementService.updateStockManagement(stockManagement);
        if(i>0){
            return success();
        }
        return error();
    }
    @DeleteMapping("/delete/{id}")// åˆ é™¤å‡ºåº“记录
    public AjaxResult deleteStockOut(@PathVariable Long id) {
        int i = stockManagementService.deleteStockManagement(id);
        if(i>0){
            return success();
        }
        return error();
    }
}
src/main/java/com/ruoyi/inventory/controller/StockOutController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.ruoyi.inventory.controller;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.inventory.domain.StockIn;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.mapper.StockProductMapper;
import com.ruoyi.inventory.service.StockOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import inventory.domain.StockOut;
@RestController
@RequestMapping("/stockout")
public class StockOutController extends BaseController {
    @Autowired
    private StockOutService stockOutService;
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @RequestMapping("/add")
    public AjaxResult addStockOut(StockOut stockOut) {
        int i = stockOutService.addStockOut(stockOut);
        if(i>0){
            return success();
        }
        return error();
    }
    @RequestMapping("/list")
    public AjaxResult listStockOuts() {
        List<StockOut> stockOuts = stockOutService.getStockOuts();
        return success(stockOuts);
    }
    @RequestMapping("/{id}")
    public AjaxResult getStockOutById(@PathVariable Long id) {
        StockOut stockOut = stockOutService.getStockOutById(id);
        return success(stockOut);
    }
    @RequestMapping("/update")
    public AjaxResult updateStockOut(@RequestBody StockOut stockOut) {
        int i = stockOutService.updateStockOut(stockOut);
        if(i>0){
            return success();
        }
        return error();
    }
    @RequestMapping("/delete/{id}")
    public AjaxResult deleteStockOut(Long id) {
        int i = stockOutService.deleteStockOut(id);
        if(i>0){
            return success();
        }
        return error();
    }
}
src/main/java/com/ruoyi/inventory/domain/StockIn.java
@@ -1,8 +1,11 @@
package inventory.domain;
package com.ruoyi.inventory.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import inventory.domain.StockProduct;
import lombok.Data;
/**
@@ -67,4 +70,5 @@
    private String inboundPerson;
    private static final long serialVersionUID = 1L;
    private List<StockProduct> stockProducts;
}
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java
@@ -1,6 +1,8 @@
package inventory.mapper;
package com.ruoyi.inventory.mapper;
import inventory.domain.StockIn;
import com.ruoyi.inventory.domain.StockIn;
import java.util.List;
/**
* @author 86151
@@ -12,14 +14,12 @@
    int deleteByPrimaryKey(Long id);
    int insert(StockIn record);
    int insertSelective(StockIn record);
    StockIn selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockIn record);
    int updateByPrimaryKey(StockIn record);
    List<StockIn> selectList();
}
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java
@@ -1,6 +1,8 @@
package inventory.mapper;
package com.ruoyi.inventory.mapper;
import inventory.domain.StockManagement;
import java.util.List;
/**
* @author 86151
@@ -9,10 +11,8 @@
* @Entity inventory.domain.StockManagement
*/
public interface StockManagementMapper {
    List<StockManagement> selectAll();
    int deleteByPrimaryKey(Long id);
    int insert(StockManagement record);
    int insertSelective(StockManagement record);
@@ -20,6 +20,5 @@
    int updateByPrimaryKeySelective(StockManagement record);
    int updateByPrimaryKey(StockManagement record);
}
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java
@@ -1,6 +1,8 @@
package inventory.mapper;
package com.ruoyi.inventory.mapper;
import inventory.domain.StockOut;
import java.util.List;
/**
* @author 86151
@@ -12,14 +14,12 @@
    int deleteByPrimaryKey(Long id);
    int insert(StockOut record);
    List<StockOut> selectAll();
    int insertSelective(StockOut record);
    StockOut selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockOut record);
    int updateByPrimaryKey(StockOut record);
}
src/main/java/com/ruoyi/inventory/mapper/StockProductMapper.java
@@ -1,6 +1,8 @@
package inventory.mapper;
package com.ruoyi.inventory.mapper;
import inventory.domain.StockProduct;
import java.util.List;
/**
* @author 86151
@@ -9,10 +11,8 @@
* @Entity inventory.domain.StockProduct
*/
public interface StockProductMapper {
    List<StockProduct> selectList();
    int deleteByPrimaryKey(Long id);
    int insert(StockProduct record);
    int insertSelective(StockProduct record);
@@ -20,6 +20,5 @@
    int updateByPrimaryKeySelective(StockProduct record);
    int updateByPrimaryKey(StockProduct record);
}
src/main/java/com/ruoyi/inventory/service/StockInService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.ruoyi.inventory.service;
import com.ruoyi.inventory.domain.StockIn;
import java.util.List;
public interface StockInService {
    int addStockIn(StockIn stockIn);
    List<StockIn> listStockIns();
    StockIn getStockInById(Long id);
    int updateStockIn(StockIn stockIn);
    int deleteStockIn(Long id);
}
src/main/java/com/ruoyi/inventory/service/StockManagementService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.ruoyi.inventory.service;
import java.util.List;
import inventory.domain.StockManagement;
public interface StockManagementService {
    List<StockManagement> getStockManagements();
    StockManagement getStockManagementById(Long id);
    int addStockManagement(StockManagement stockManagement);
    int updateStockManagement(StockManagement stockManagement);
    int deleteStockManagement(Long id);
}
src/main/java/com/ruoyi/inventory/service/StockOutService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.ruoyi.inventory.service;
import java.util.List;
import inventory.domain.StockOut;
public interface StockOutService {
    List<StockOut> getStockOuts();
    StockOut getStockOutById(Long id);
    int addStockOut(StockOut stockOut);
    int updateStockOut(StockOut stockOut);
    int deleteStockOut(Long id);
}
src/main/java/com/ruoyi/inventory/service/impl/StockInServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package com.ruoyi.inventory.service.impl;
import com.ruoyi.inventory.domain.StockIn;
import com.ruoyi.inventory.mapper.StockInMapper;
import com.ruoyi.inventory.service.StockInService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StockInServiceImpl implements StockInService {
    @Autowired
    private StockInMapper stockInMapper;
    @Override//添加库存入库信息
    public int addStockIn(StockIn stockIn) {
        int i = stockInMapper.insertSelective(stockIn);
        return i;
        }
    @Override//列出所有库存入库信息
    public List<StockIn> listStockIns() {
        List<StockIn> stockIns = stockInMapper.selectList();
        return stockIns;
    }
    @Override//根据id获取库存入库信息
    public StockIn getStockInById(Long id) {
        StockIn stockIn = stockInMapper.selectByPrimaryKey(id);
        return stockIn;
    }
    @Override//更新库存入库信息
    public int updateStockIn(StockIn stockIn) {
        int i = stockInMapper.updateByPrimaryKeySelective(stockIn);
        return i;
    }
    @Override//删除库存入库信息
    public int deleteStockIn(Long id) {
        int i = stockInMapper.deleteByPrimaryKey(id);
        return i;
    }
}
src/main/java/com/ruoyi/inventory/service/impl/StockManagementServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package com.ruoyi.inventory.service.impl;
import com.ruoyi.inventory.mapper.StockManagementMapper;
import com.ruoyi.inventory.service.StockManagementService;
import inventory.domain.StockManagement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StockManagementServiceImpl implements StockManagementService {
    @Autowired
    private StockManagementMapper stockManagementMapper;
    @Override
    public List<StockManagement> getStockManagements() {
        List<StockManagement> stockManagements = stockManagementMapper.selectAll();
        return stockManagements;
    }
    @Override
    public StockManagement getStockManagementById(Long id) {
        StockManagement stockManagement = stockManagementMapper.selectByPrimaryKey(id);
        return stockManagement;
    }
    @Override
    public int addStockManagement(StockManagement stockManagement) {
        int i = stockManagementMapper.insertSelective(stockManagement);
        return i;
    }
    @Override
    public int updateStockManagement(StockManagement stockManagement) {
        int i = stockManagementMapper.updateByPrimaryKeySelective(stockManagement);
        return i;
    }
    @Override
    public int deleteStockManagement(Long id) {
        int i = stockManagementMapper.deleteByPrimaryKey(id);
        return i;
    }
}
src/main/java/com/ruoyi/inventory/service/impl/StockOutServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package com.ruoyi.inventory.service.impl;
import com.ruoyi.inventory.mapper.StockOutMapper;
import com.ruoyi.inventory.service.StockOutService;
import inventory.domain.StockOut;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StockOutServiceImpl implements StockOutService {
    @Autowired
    private StockOutMapper stockOutMapper;
    @Override
    public List<StockOut> getStockOuts() {
        List<StockOut> stockOuts = stockOutMapper.selectAll();
        return stockOuts;
    }
    @Override
    public StockOut getStockOutById(Long id) {
        StockOut stockOut = stockOutMapper.selectByPrimaryKey(id);
        return stockOut;
    }
    @Override
    public int addStockOut(StockOut stockOut) {
        int i = stockOutMapper.insertSelective(stockOut);
        return i;
    }
    @Override
    public int updateStockOut(StockOut stockOut) {
        int i = stockOutMapper.updateByPrimaryKeySelective(stockOut);
        return i;
    }
    @Override
    public int deleteStockOut(Long id) {
        int i = stockOutMapper.deleteByPrimaryKey(id);
        return i;
    }
}
src/main/java/com/ruoyi/project/system/controller/SysPostController.java
@@ -45,6 +45,9 @@
        List<SysPost> list = postService.selectPostList(post);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºå²—位列表
     */
    
    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('system:post:export')")
src/main/resources/mapper/inventory/StockInMapper.xml
ÎļþÃû´Ó src/main/resources/mapper/StockInMapper.xml ÐÞ¸Ä
@@ -2,9 +2,9 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockInMapper">
<mapper namespace="com.ruoyi.inventory.mapper.StockInMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockIn">
    <resultMap id="BaseResultMap" type="com.ruoyi.inventory.domain.StockIn">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/>
@@ -16,6 +16,10 @@
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
            <collection property="stockProducts" ofType="com.ruoyi.inventory.domain.StockProduct"
                        select="com.ruoyi.inventory.mapper.StockProductMapper.selectByPrimaryKey" column="productId">
                <id property="id" column="productId" jdbcType="INTEGER"/>
            </collection>
    </resultMap>
    <sql id="Base_Column_List">
@@ -31,22 +35,23 @@
        from stock_in
        where  id = #{id,jdbcType=INTEGER} 
    </select>
    <select id="selectList" resultType="com.ruoyi.inventory.domain.StockIn">
        select
        <include refid="Base_Column_List" />
        from stock_in
    </select>
    <select id="selectListByPage" resultType="com.ruoyi.inventory.domain.StockIn">
        select
        <include refid="Base_Column_List" />
        from stock_in
        limit #{pageNum},#{pageSize}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_in
        where  id = #{id,jdbcType=INTEGER} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true">
        insert into stock_in
        ( id,product_id,inbound_time
        ,inbound_batch,supplier_name,inbound_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP}
        ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true">
        insert into stock_in
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -76,6 +81,7 @@
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockIn">
        update stock_in
        <set>
@@ -112,19 +118,5 @@
        </set>
        where   id = #{id,jdbcType=INTEGER} 
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockIn">
        update stock_in
        set
            product_id =  #{productId,jdbcType=INTEGER},
            inbound_time =  #{inboundTime,jdbcType=TIMESTAMP},
            inbound_batch =  #{inboundBatch,jdbcType=VARCHAR},
            supplier_name =  #{supplierName,jdbcType=VARCHAR},
            inbound_quantity =  #{inboundQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/inventory/StockManagementMapper.xml
ÎļþÃû´Ó src/main/resources/mapper/StockManagementMapper.xml ÐÞ¸Ä
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockManagementMapper">
<mapper namespace="com.ruoyi.inventory.mapper.StockManagementMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockManagement">
            <id property="id" column="id" jdbcType="INTEGER"/>
@@ -27,20 +27,17 @@
        from stock_management
        where  id = #{id,jdbcType=INTEGER} 
    </select>
    <select id="selectAll" resultType="inventory.domain.StockManagement">
        select
        <include refid="Base_Column_List" />
        from stock_management
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_management
        where  id = #{id,jdbcType=INTEGER} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true">
        insert into stock_management
        ( id,product_id,stock_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{stockQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true">
        insert into stock_management
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -91,16 +88,5 @@
        </set>
        where   id = #{id,jdbcType=INTEGER} 
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockManagement">
        update stock_management
        set
            product_id =  #{productId,jdbcType=INTEGER},
            stock_quantity =  #{stockQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/inventory/StockOutMapper.xml
ÎļþÃû´Ó src/main/resources/mapper/StockOutMapper.xml ÐÞ¸Ä
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockOutMapper">
<mapper namespace="com.ruoyi.inventory.mapper.StockOutMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockOut">
            <id property="id" column="id" jdbcType="INTEGER"/>
@@ -31,22 +31,17 @@
        from stock_out
        where  id = #{id,jdbcType=INTEGER} 
    </select>
    <select id="selectAll" resultType="inventory.domain.StockOut">
        select
        <include refid="Base_Column_List" />
        from stock_out
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_out
        where  id = #{id,jdbcType=INTEGER} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true">
        insert into stock_out
        ( id,product_id,inbound_time
        ,inbound_batch,supplier_name,inbound_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP}
        ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true">
        insert into stock_out
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -112,19 +107,5 @@
        </set>
        where   id = #{id,jdbcType=INTEGER} 
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockOut">
        update stock_out
        set
            product_id =  #{productId,jdbcType=INTEGER},
            inbound_time =  #{inboundTime,jdbcType=TIMESTAMP},
            inbound_batch =  #{inboundBatch,jdbcType=VARCHAR},
            supplier_name =  #{supplierName,jdbcType=VARCHAR},
            inbound_quantity =  #{inboundQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/inventory/StockProductMapper.xml
ÎļþÃû´Ó src/main/resources/mapper/StockProductMapper.xml ÐÞ¸Ä
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockProductMapper">
<mapper namespace="com.ruoyi.inventory.mapper.StockProductMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockProduct">
            <id property="id" column="id" jdbcType="INTEGER"/>
@@ -22,18 +22,17 @@
        from stock_product
        where  id = #{id,jdbcType=INTEGER} 
    </select>
    <select id="selectList" resultType="inventory.domain.StockProduct">
        select
        <include refid="Base_Column_List" />
        from stock_product
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_product
        where  id = #{id,jdbcType=INTEGER} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true">
        insert into stock_product
        ( id,product_category,spec_model
        ,unit)
        values (#{id,jdbcType=INTEGER},#{productCategory,jdbcType=VARCHAR},#{specModel,jdbcType=VARCHAR}
        ,#{unit,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true">
        insert into stock_product
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -64,12 +63,5 @@
        </set>
        where   id = #{id,jdbcType=INTEGER} 
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockProduct">
        update stock_product
        set
            product_category =  #{productCategory,jdbcType=VARCHAR},
            spec_model =  #{specModel,jdbcType=VARCHAR},
            unit =  #{unit,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>