库存明细查询
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
<?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.search.ViewStockDetail.mapper.ViewStockDetailMapper">
|
||||
|
||||
<resultMap type="ViewStockDetail" id="ViewStockDetailResult">
|
||||
<result property="onlyIdentity" column="only_identity" />
|
||||
<result property="stockId" column="stock_id" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="jobId" column="job_id" />
|
||||
<result property="lotNo" column="lot_no" />
|
||||
<result property="stockinDetailId" column="stockin_detail_id" />
|
||||
<result property="inDate" column="in_date" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="stackingId" column="stacking_id" />
|
||||
<result property="cargoSpaceName" column="cargo_space_name" />
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="cargoSpaceStatus" column="cargo_space_status" />
|
||||
<result property="locked" column="locked" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="price" column="price" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewStockDetailVo">
|
||||
select only_identity, stock_id, cargo_space_id, tray_code, quantity, job_id, lot_no, stockin_detail_id, in_date, warehouse_id, stacking_id, cargo_space_name, roadway_id, cargo_space_status, locked, product_id, product_name, spec, unit, price from view_stock_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
|
||||
<include refid="selectViewStockDetailVo"/>
|
||||
<where>
|
||||
<if test="onlyIdentity != null "> and only_identity = #{onlyIdentity}</if>
|
||||
<if test="stockId != null and stockId != ''"> and stock_id like concat('%', #{stockId}, '%')</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code like concat('%', #{trayCode}, '%')</if>
|
||||
<if test="quantity != null and quantity != ''"> and quantity like concat('%', #{quantity}, '%')</if>
|
||||
<if test="jobId != null and jobId != ''"> and job_id like concat('%', #{jobId}, '%')</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and lot_no like concat('%', #{lotNo}, '%')</if>
|
||||
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id like concat('%', #{stockinDetailId}, '%')</if>
|
||||
<if test="inDate != null and inDate != ''"> and in_date like concat('%', #{inDate}, '%')</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%', #{warehouseId}, '%')</if>
|
||||
<if test="stackingId != null and stackingId != ''"> and stacking_id like concat('%', #{stackingId}, '%')</if>
|
||||
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and roadway_id like concat('%', #{roadwayId}, '%')</if>
|
||||
<if test="cargoSpaceStatus != null and cargoSpaceStatus != ''"> and cargo_space_status like concat('%', #{cargoSpaceStatus}, '%')</if>
|
||||
<if test="locked != null and locked != ''"> and locked like concat('%', #{locked}, '%')</if>
|
||||
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</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>
|
||||
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectViewStockDetailByOnlyIdentity" parameterType="Long" resultMap="ViewStockDetailResult">
|
||||
<include refid="selectViewStockDetailVo"/>
|
||||
where only_identity = #{onlyIdentity}
|
||||
</select>
|
||||
|
||||
<insert id="insertViewStockDetail" parameterType="ViewStockDetail">
|
||||
insert into view_stock_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="onlyIdentity != null">only_identity,</if>
|
||||
<if test="stockId != null and stockId != ''">stock_id,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="jobId != null">job_id,</if>
|
||||
<if test="lotNo != null">lot_no,</if>
|
||||
<if test="stockinDetailId != null">stockin_detail_id,</if>
|
||||
<if test="inDate != null">in_date,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="stackingId != null">stacking_id,</if>
|
||||
<if test="cargoSpaceName != null">cargo_space_name,</if>
|
||||
<if test="roadwayId != null">roadway_id,</if>
|
||||
<if test="cargoSpaceStatus != null">cargo_space_status,</if>
|
||||
<if test="locked != null">locked,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="spec != null">spec,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="price != null">price,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="onlyIdentity != null">#{onlyIdentity},</if>
|
||||
<if test="stockId != null and stockId != ''">#{stockId},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
<if test="lotNo != null">#{lotNo},</if>
|
||||
<if test="stockinDetailId != null">#{stockinDetailId},</if>
|
||||
<if test="inDate != null">#{inDate},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="stackingId != null">#{stackingId},</if>
|
||||
<if test="cargoSpaceName != null">#{cargoSpaceName},</if>
|
||||
<if test="roadwayId != null">#{roadwayId},</if>
|
||||
<if test="cargoSpaceStatus != null">#{cargoSpaceStatus},</if>
|
||||
<if test="locked != null">#{locked},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="spec != null">#{spec},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateViewStockDetail" parameterType="ViewStockDetail">
|
||||
update view_stock_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stockId != null and stockId != ''">stock_id = #{stockId},</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="jobId != null">job_id = #{jobId},</if>
|
||||
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
||||
<if test="stockinDetailId != null">stockin_detail_id = #{stockinDetailId},</if>
|
||||
<if test="inDate != null">in_date = #{inDate},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="stackingId != null">stacking_id = #{stackingId},</if>
|
||||
<if test="cargoSpaceName != null">cargo_space_name = #{cargoSpaceName},</if>
|
||||
<if test="roadwayId != null">roadway_id = #{roadwayId},</if>
|
||||
<if test="cargoSpaceStatus != null">cargo_space_status = #{cargoSpaceStatus},</if>
|
||||
<if test="locked != null">locked = #{locked},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="spec != null">spec = #{spec},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
</trim>
|
||||
where only_identity = #{onlyIdentity}
|
||||
</update>
|
||||
|
||||
<delete id="deleteViewStockDetailByOnlyIdentity" parameterType="Long">
|
||||
delete from view_stock_detail where only_identity = #{onlyIdentity}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteViewStockDetailByOnlyIdentitys" parameterType="String">
|
||||
delete from view_stock_detail where only_identity in
|
||||
<foreach item="onlyIdentity" collection="array" open="(" separator="," close=")">
|
||||
#{onlyIdentity}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user