项目初始化
This commit is contained in:
@@ -0,0 +1,236 @@
|
||||
<?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="spare3" column="spare3" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="spare6" column="spare6" />
|
||||
<result property="price" column="price" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="cargoNo" column="cargo_no" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="power" column="power" />
|
||||
<result property="spare8" column="spare8" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="stockinId" column="stockin_id" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="supplierNo" column="supplier_no" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="inDate" column="in_date" />
|
||||
<result property="stackingId" column="stacking_id" />
|
||||
<result property="spare7" column="spare7" />
|
||||
<result property="backDate" column="back_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="stockId" column="stock_id" />
|
||||
<result property="stockStatus" column="stock_status" />
|
||||
<result property="lotNo" column="lot_no" />
|
||||
<result property="outQuantity" column="out_quantity" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="productType" column="productType" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewStockDetailVo">
|
||||
select bs.spare3, --账套
|
||||
bs.cargo_space_id, --库位编码
|
||||
bs.tray_code, --托盘
|
||||
bs.product_id, --产品编码
|
||||
bs.product_name,--产品名称
|
||||
bp.spec, -- 规格
|
||||
bs.quantity, -- 数量
|
||||
bs.spare6, -- 金额
|
||||
bp.price, --单价
|
||||
bp.spare1 as productType, --产品状态
|
||||
bp.unit, -- 单位
|
||||
bp.cargo_no, --图号
|
||||
bs.order_id, --合同号
|
||||
bs.spare5, --台次
|
||||
bs.power, --件次
|
||||
bs.spare8, --质量
|
||||
bp.parent_id, --常用编码
|
||||
bs.stockin_id, --入库单号
|
||||
bs2.supplier_name, --供应商名称
|
||||
bs2.supplier_no, --供应商编号
|
||||
bw.warehouse_id, --仓库编码
|
||||
bw.warehouse_name, --仓库名称
|
||||
bs.in_date, --入库时间
|
||||
bs.stacking_id, --出库时间
|
||||
bs.spare7, --盘点标识
|
||||
bs.back_date, --盘点时间
|
||||
bp.remark, --备注
|
||||
bs.stock_id, --库存编码
|
||||
bs.stock_status, --库存状态
|
||||
bs.lot_no, --批次号
|
||||
bs.out_quantity,
|
||||
bs.spare4, --来源
|
||||
bs.spare1 --用途
|
||||
from bas_stock bs
|
||||
left join bas_product bp on bs.product_id = bp.product_id
|
||||
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
|
||||
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id
|
||||
left join bas_supplier bs2 on bs.phase = bs2.supplier_no
|
||||
</sql>
|
||||
|
||||
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
|
||||
<include refid="selectViewStockDetailVo"/>
|
||||
<where>
|
||||
<if test="stockId != null and stockId != ''"> and bs.stock_id = #{stockId}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bs.cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="stockStatus != null and stockStatus != ''"> and bs.stock_status = #{stockStatus}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and bs.lot_no = #{lotNo}</if>
|
||||
<if test="inDate != null and inDate != ''"> and bs.in_date like concat('%', #{inDate}, '%')</if>
|
||||
<if test="backDate != null and backDate != ''"> and bs.back_date = #{backDate}</if>
|
||||
<if test="productName != null and productName != ''"> and bs.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="quantity != null and quantity != ''"> and bs.quantity = #{quantity}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and bs.tray_code = #{trayCode}</if>
|
||||
<if test="outQuantity != null and outQuantity != ''"> and bs.out_quantity = #{outQuantity}</if>
|
||||
<if test="stockinId != null and stockinId != ''"> and bs.stockin_id = #{stockinId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if>
|
||||
<if test="stackingId != null and stackingId != ''"> and bs.stacking_id = #{stackingId}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and bs.spare1 = #{spare1}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and bs.spare3 = #{spare3}</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and bs.spare4 = #{spare4}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and bs.spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and bs.spare6 = #{spare6}</if>
|
||||
<if test="voltage != null and voltage != ''"> and bs.voltage = #{voltage}</if>
|
||||
<if test="power != null and power != ''"> and bs.power = #{power}</if>
|
||||
<if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if>
|
||||
<if test="productId != null and productId != ''"> and bs.product_id = #{productId}</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
|
||||
<if test="theFloor != null and theFloor != ''"> and bcs.the_floor = #{theFloor}</if>
|
||||
<if test="thePlatoon != null and thePlatoon != ''"> and bcs.the_platoon = #{thePlatoon}</if>
|
||||
<if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if>
|
||||
<if test="spec != null and spec != ''"> and bp.spec = #{spec}</if>
|
||||
<if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and bs2.supplier_no = #{supplierId}</if>
|
||||
<if test="supplierName != null and supplierName != ''"> and bs2.supplier_name = #{supplierName}</if>
|
||||
<if test="price != null and price != ''"> and bp.price = #{price}</if>
|
||||
<if test="inDateStart != null and inDateStart != ''"> and bs.in_date >= #{inDateStart}</if>
|
||||
<if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date <= #{inDateEnd}</if>
|
||||
<if test="productType != null and productType != ''"> and bp.spare1 = #{productType}</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</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>
|
||||
</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</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>
|
||||
</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>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</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>
|
||||
</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