From d3d6287a3222b9c85a56e4c55c35350c4233c7db Mon Sep 17 00:00:00 2001 From: yaowanxin <3588231647@qq.com> Date: 星期二, 24 六月 2025 18:05:41 +0800 Subject: [PATCH] 库存管理简练 --- src/main/resources/mapper/inventory/StockManagementMapper.xml | 30 ++++++++---------------------- 1 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/main/resources/mapper/StockManagementMapper.xml b/src/main/resources/mapper/inventory/StockManagementMapper.xml similarity index 76% rename from src/main/resources/mapper/StockManagementMapper.xml rename to src/main/resources/mapper/inventory/StockManagementMapper.xml index eed2424..93ca524 100644 --- a/src/main/resources/mapper/StockManagementMapper.xml +++ b/src/main/resources/mapper/inventory/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> -- Gitblit v1.9.3