物料基本信息管理修改

This commit is contained in:
liuhanqing
2025-09-11 16:15:55 +08:00
parent fd797fe91d
commit e98b7969c7
8 changed files with 336 additions and 421 deletions

View File

@@ -3,142 +3,117 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bas.BasProduct.mapper.BasProductMapper">
<resultMap type="BasProduct" id="BasProductResult">
<result property="productGuid" column="product_guid" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="spare4" column="spare4" />
<result property="spare7" column="spare7" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare8" column="spare8" />
<result property="spare3" column="spare3" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="remark" column="remark" />
<result property="parentId" column="parent_id" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="spare7" column="spare7" />
<result property="spare8" column="spare8" />
<result property="spare9" column="spare9" />
<result property="productName" column="product_name" />
</resultMap>
<sql id="selectBasProductVo">
select product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9 from bas_product
select product_guid, product_id, product_name, spare4, spare7, spare1, spare2, spare8, spare3, spare5, spare6, remark, parent_id, price, cargo_no, unit, spec, spare9 from bas_product
</sql>
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
<where>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%', #{parentId}, '%')</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''"> and spare6 like concat('%', #{spare6}, '%')</if>
<if test="spare7 != null and spare7 != ''"> and spare7 like concat('%', #{spare7}, '%')</if>
<if test="spare8 != null and spare8 != ''"> and spare8 like concat('%', #{spare8}, '%')</if>
<if test="spare9 != null and spare9 != ''"> and spare9 like concat('%', #{spare9}, '%')</if>
<where>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectBasProductByProductGuid" parameterType="String" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
where product_guid = #{productGuid}
</select>
<select id="selectBasProductListByProductGuids" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
where product_guid in
<foreach collection="productGuids" item="productGuid" open="(" separator="," close=")">
#{productGuid}
</foreach>
</select>
<select id="selectBasProductByProductId" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
<include refid="selectBasProductVo"/>
where product_id = #{productId}
</select>
<select id="selectBasProductListByProductIds" resultType="com.ruoyi.bas.BasProduct.domain.BasProduct">
<include refid="selectBasProductVo"/>
where product_id in
<foreach collection="productIds" item="productId" open="(" separator="," close=")">
#{productId}
</foreach>
</select>
<insert id="insertBasProduct" parameterType="BasProduct">
insert into bas_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productGuid != null">product_guid,</if>
<if test="productId != null and productId != ''">product_id,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare8 != null">spare8,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="remark != null">remark,</if>
<if test="parentId != null">parent_id,</if>
<if test="price != null">price,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="unit != null">unit,</if>
<if test="spec != null">spec,</if>
<if test="remark != null">remark,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare8 != null">spare8,</if>
<if test="spare9 != null">spare9,</if>
<if test="productName != null and productName != ''">product_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productGuid != null">#{productGuid},</if>
<if test="productId != null and productId != ''">#{productId},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="remark != null">#{remark},</if>
<if test="parentId != null">#{parentId},</if>
<if test="price != null">#{price},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="spare9 != null">#{spare9},</if>
<if test="productName != null and productName != ''">#{productName},</if>
</trim>
</insert>
<update id="updateBasProduct" parameterType="BasProduct">
update bas_product
<trim prefix="SET" suffixOverrides=",">
<if test="productId != null and productId != ''">product_id = #{productId},</if>
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="price != null">price = #{price},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="spare9 != null">spare9 = #{spare9},</if>
<if test="productName != null and productName != ''">product_name = #{productName},</if>
</trim>
where product_guid = #{productGuid}
</update>
@@ -148,9 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteBasProductByProductGuids" parameterType="String">
delete from bas_product where product_guid in
delete from bas_product where product_guid in
<foreach item="productGuid" collection="array" open="(" separator="," close=")">
#{productGuid}
</foreach>
</delete>
</mapper>
</mapper>