183 lines
11 KiB
XML
183 lines
11 KiB
XML
<?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.ruoyi.out.productAndStock.mapper.ViewProductAndStockMapper">
|
|
|
|
<resultMap type="ViewProductAndStock" id="ViewProductAndStockResult">
|
|
<result property="onlyIdentity" column="only_identity" />
|
|
<result property="productId" column="product_id" />
|
|
<result property="lotNo" column="lot_no" />
|
|
<result property="productName" column="product_name" />
|
|
<result property="quantity" column="quantity" />
|
|
<result property="warehouseId" column="warehouse_id" />
|
|
<result property="spare1" column="spare1" />
|
|
<result property="spare3" column="spare3" />
|
|
<result property="spare4" column="spare4" />
|
|
<result property="spare5" column="spare5" />
|
|
<result property="spare6" column="spare6" />
|
|
<result property="voltage" column="voltage" />
|
|
<result property="power" column="power" />
|
|
<result property="phase" column="phase" />
|
|
<result property="distribution" column="distribution" />
|
|
<result property="orderId" column="order_id" />
|
|
<result property="spare8" column="spare8" />
|
|
<result property="price" column="price" />
|
|
<result property="cargoNo" column="cargo_no" />
|
|
<result property="productStatus" column="product_status" />
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="spare7" column="spare7" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createSys" column="create_sys" />
|
|
<result property="spec" column="spec" />
|
|
<result property="unit" column="unit" />
|
|
<result property="supplierName" column="supplier_name" />
|
|
</resultMap>
|
|
|
|
<sql id="selectViewProductAndStockVo">
|
|
select only_identity, product_id, lot_no, product_name, quantity, warehouse_id, spare1, spare3, spare4, spare5, spare6, voltage, power, phase, distribution, order_id, spare8, price, cargo_no, product_status, parent_id, spare7, create_time, create_sys, spec, unit,supplier_name from view_product_and_stock
|
|
</sql>
|
|
|
|
<select id="selectViewProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult">
|
|
<include refid="selectViewProductAndStockVo"/>
|
|
<where>
|
|
<if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if>
|
|
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
|
|
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
|
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
|
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
|
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
|
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
|
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
|
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
|
|
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if>
|
|
<if test="power != null and power != ''"> and power = #{power}</if>
|
|
<if test="phase != null and phase != ''"> and phase = #{phase}</if>
|
|
<if test="distribution != null and distribution != ''"> and distribution like concat('%', #{distribution}, '%')</if>
|
|
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
|
|
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
|
|
<if test="price != null and price != ''"> and price = #{price}</if>
|
|
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
|
|
<if test="productStatus != null and productStatus != ''"> and product_status = #{productStatus}</if>
|
|
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
|
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
|
|
<if test="createSys != null and createSys != ''"> and create_sys like concat('%', #{createSys}, '%')</if>
|
|
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
|
|
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
|
|
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectViewProductAndStockByOnlyIdentity" parameterType="Long" resultMap="ViewProductAndStockResult">
|
|
<include refid="selectViewProductAndStockVo"/>
|
|
where only_identity = #{onlyIdentity}
|
|
</select>
|
|
|
|
<insert id="insertViewProductAndStock" parameterType="ViewProductAndStock">
|
|
insert into view_product_and_stock
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="onlyIdentity != null">only_identity,</if>
|
|
<if test="productId != null">product_id,</if>
|
|
<if test="lotNo != null">lot_no,</if>
|
|
<if test="productName != null">product_name,</if>
|
|
<if test="quantity != null">quantity,</if>
|
|
<if test="warehouseId != null">warehouse_id,</if>
|
|
<if test="spare1 != null">spare1,</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="voltage != null">voltage,</if>
|
|
<if test="power != null">power,</if>
|
|
<if test="phase != null">phase,</if>
|
|
<if test="distribution != null">distribution,</if>
|
|
<if test="orderId != null">order_id,</if>
|
|
<if test="spare8 != null">spare8,</if>
|
|
<if test="price != null">price,</if>
|
|
<if test="cargoNo != null">cargo_no,</if>
|
|
<if test="productStatus != null">product_status,</if>
|
|
<if test="parentId != null">parent_id,</if>
|
|
<if test="spare7 != null">spare7,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createSys != null">create_sys,</if>
|
|
<if test="spec != null">spec,</if>
|
|
<if test="unit != null">unit,</if>
|
|
<if test="supplierName != null">supplier_name,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="onlyIdentity != null">#{onlyIdentity},</if>
|
|
<if test="productId != null">#{productId},</if>
|
|
<if test="lotNo != null">#{lotNo},</if>
|
|
<if test="productName != null">#{productName},</if>
|
|
<if test="quantity != null">#{quantity},</if>
|
|
<if test="warehouseId != null">#{warehouseId},</if>
|
|
<if test="spare1 != null">#{spare1},</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="voltage != null">#{voltage},</if>
|
|
<if test="power != null">#{power},</if>
|
|
<if test="phase != null">#{phase},</if>
|
|
<if test="distribution != null">#{distribution},</if>
|
|
<if test="orderId != null">#{orderId},</if>
|
|
<if test="spare8 != null">#{spare8},</if>
|
|
<if test="price != null">#{price},</if>
|
|
<if test="cargoNo != null">#{cargoNo},</if>
|
|
<if test="productStatus != null">#{productStatus},</if>
|
|
<if test="parentId != null">#{parentId},</if>
|
|
<if test="spare7 != null">#{spare7},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createSys != null">#{createSys},</if>
|
|
<if test="spec != null">#{spec},</if>
|
|
<if test="unit != null">#{unit},</if>
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateViewProductAndStock" parameterType="ViewProductAndStock">
|
|
update view_product_and_stock
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="productId != null">product_id = #{productId},</if>
|
|
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
|
<if test="productName != null">product_name = #{productName},</if>
|
|
<if test="quantity != null">quantity = #{quantity},</if>
|
|
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
|
<if test="spare1 != null">spare1 = #{spare1},</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="voltage != null">voltage = #{voltage},</if>
|
|
<if test="power != null">power = #{power},</if>
|
|
<if test="phase != null">phase = #{phase},</if>
|
|
<if test="distribution != null">distribution = #{distribution},</if>
|
|
<if test="orderId != null">order_id = #{orderId},</if>
|
|
<if test="spare8 != null">spare8 = #{spare8},</if>
|
|
<if test="price != null">price = #{price},</if>
|
|
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
|
|
<if test="productStatus != null">product_status = #{productStatus},</if>
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
<if test="spare7 != null">spare7 = #{spare7},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createSys != null">create_sys = #{createSys},</if>
|
|
<if test="spec != null">spec = #{spec},</if>
|
|
<if test="unit != null">unit = #{unit},</if>
|
|
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
</trim>
|
|
where only_identity = #{onlyIdentity}
|
|
</update>
|
|
|
|
<delete id="deleteViewProductAndStockByOnlyIdentity" parameterType="Long">
|
|
delete from view_product_and_stock where only_identity = #{onlyIdentity}
|
|
</delete>
|
|
|
|
<delete id="deleteViewProductAndStockByOnlyIdentitys" parameterType="String">
|
|
delete from view_product_and_stock where only_identity in
|
|
<foreach item="onlyIdentity" collection="array" open="(" separator="," close=")">
|
|
#{onlyIdentity}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |