141 lines
8.3 KiB
XML
141 lines
8.3 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.app.mapper.AppStockMapper">
|
||
|
|
|
||
|
|
<resultMap type="AppStock" id="AppStockResult">
|
||
|
|
<result property="stockId" column="stock_id" />
|
||
|
|
<result property="vehicleId" column="vehicle_id" />
|
||
|
|
<result property="locationId" column="location_id" />
|
||
|
|
<result property="goodsId" column="goods_id" />
|
||
|
|
<result property="goodsName" column="goods_name" />
|
||
|
|
<result property="goodsUnit" column="goods_unit" />
|
||
|
|
<result property="providerId" column="provider_id" />
|
||
|
|
<result property="providerName" column="provider_name" />
|
||
|
|
<result property="remainNum" column="remain_num" />
|
||
|
|
<result property="originNum" column="origin_num" />
|
||
|
|
<result property="batchNo" column="batch_no" />
|
||
|
|
<result property="invAge" column="inv_age" />
|
||
|
|
<result property="goodsStatus" column="goods_status" />
|
||
|
|
<result property="stockStatus" column="stock_status" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="createUser" column="create_user" />
|
||
|
|
<result property="lastUpdateTime" column="last_update_time" />
|
||
|
|
<result property="lastUpdateUser" column="last_update_user" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectAppStockVo">
|
||
|
|
select stock_id, vehicle_id, location_id, goods_id, goods_name, goods_unit, provider_id, provider_name, remain_num, origin_num, batch_no, inv_age, goods_status, stock_status, create_time, create_user, last_update_time, last_update_user, remark from app_stock
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectAppStockList" parameterType="AppStock" resultMap="AppStockResult">
|
||
|
|
<include refid="selectAppStockVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="vehicleId != null and vehicleId != ''"> and vehicle_id = #{vehicleId}</if>
|
||
|
|
<if test="locationId != null and locationId != ''"> and location_id = #{locationId}</if>
|
||
|
|
<if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId}</if>
|
||
|
|
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
|
||
|
|
<if test="goodsUnit != null and goodsUnit != ''"> and goods_unit = #{goodsUnit}</if>
|
||
|
|
<if test="providerId != null and providerId != ''"> and provider_id = #{providerId}</if>
|
||
|
|
<if test="providerName != null and providerName != ''"> and provider_name like concat('%', #{providerName}, '%')</if>
|
||
|
|
<if test="remainNum != null "> and remain_num = #{remainNum}</if>
|
||
|
|
<if test="originNum != null "> and origin_num = #{originNum}</if>
|
||
|
|
<if test="batchNo != null and batchNo != ''"> and batch_no = #{batchNo}</if>
|
||
|
|
<if test="invAge != null "> and inv_age = #{invAge}</if>
|
||
|
|
<if test="goodsStatus != null "> and goods_status = #{goodsStatus}</if>
|
||
|
|
<if test="stockStatus != null "> and stock_status = #{stockStatus}</if>
|
||
|
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
||
|
|
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
|
||
|
|
<if test="lastUpdateUser != null and lastUpdateUser != ''"> and last_update_user = #{lastUpdateUser}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectAppStockByStockId" parameterType="String" resultMap="AppStockResult">
|
||
|
|
<include refid="selectAppStockVo"/>
|
||
|
|
where stock_id = #{stockId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertAppStock" parameterType="AppStock">
|
||
|
|
insert into app_stock
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="stockId != null">stock_id,</if>
|
||
|
|
<if test="vehicleId != null and vehicleId != ''">vehicle_id,</if>
|
||
|
|
<if test="locationId != null and locationId != ''">location_id,</if>
|
||
|
|
<if test="goodsId != null and goodsId != ''">goods_id,</if>
|
||
|
|
<if test="goodsName != null">goods_name,</if>
|
||
|
|
<if test="goodsUnit != null">goods_unit,</if>
|
||
|
|
<if test="providerId != null and providerId != ''">provider_id,</if>
|
||
|
|
<if test="providerName != null">provider_name,</if>
|
||
|
|
<if test="remainNum != null">remain_num,</if>
|
||
|
|
<if test="originNum != null">origin_num,</if>
|
||
|
|
<if test="batchNo != null">batch_no,</if>
|
||
|
|
<if test="invAge != null">inv_age,</if>
|
||
|
|
<if test="goodsStatus != null">goods_status,</if>
|
||
|
|
<if test="stockStatus != null">stock_status,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="createUser != null">create_user,</if>
|
||
|
|
<if test="lastUpdateTime != null">last_update_time,</if>
|
||
|
|
<if test="lastUpdateUser != null">last_update_user,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="stockId != null">#{stockId},</if>
|
||
|
|
<if test="vehicleId != null and vehicleId != ''">#{vehicleId},</if>
|
||
|
|
<if test="locationId != null and locationId != ''">#{locationId},</if>
|
||
|
|
<if test="goodsId != null and goodsId != ''">#{goodsId},</if>
|
||
|
|
<if test="goodsName != null">#{goodsName},</if>
|
||
|
|
<if test="goodsUnit != null">#{goodsUnit},</if>
|
||
|
|
<if test="providerId != null and providerId != ''">#{providerId},</if>
|
||
|
|
<if test="providerName != null">#{providerName},</if>
|
||
|
|
<if test="remainNum != null">#{remainNum},</if>
|
||
|
|
<if test="originNum != null">#{originNum},</if>
|
||
|
|
<if test="batchNo != null">#{batchNo},</if>
|
||
|
|
<if test="invAge != null">#{invAge},</if>
|
||
|
|
<if test="goodsStatus != null">#{goodsStatus},</if>
|
||
|
|
<if test="stockStatus != null">#{stockStatus},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="createUser != null">#{createUser},</if>
|
||
|
|
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
|
||
|
|
<if test="lastUpdateUser != null">#{lastUpdateUser},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateAppStock" parameterType="AppStock">
|
||
|
|
update app_stock
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="vehicleId != null and vehicleId != ''">vehicle_id = #{vehicleId},</if>
|
||
|
|
<if test="locationId != null and locationId != ''">location_id = #{locationId},</if>
|
||
|
|
<if test="goodsId != null and goodsId != ''">goods_id = #{goodsId},</if>
|
||
|
|
<if test="goodsName != null">goods_name = #{goodsName},</if>
|
||
|
|
<if test="goodsUnit != null">goods_unit = #{goodsUnit},</if>
|
||
|
|
<if test="providerId != null and providerId != ''">provider_id = #{providerId},</if>
|
||
|
|
<if test="providerName != null">provider_name = #{providerName},</if>
|
||
|
|
<if test="remainNum != null">remain_num = #{remainNum},</if>
|
||
|
|
<if test="originNum != null">origin_num = #{originNum},</if>
|
||
|
|
<if test="batchNo != null">batch_no = #{batchNo},</if>
|
||
|
|
<if test="invAge != null">inv_age = #{invAge},</if>
|
||
|
|
<if test="goodsStatus != null">goods_status = #{goodsStatus},</if>
|
||
|
|
<if test="stockStatus != null">stock_status = #{stockStatus},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="createUser != null">create_user = #{createUser},</if>
|
||
|
|
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</if>
|
||
|
|
<if test="lastUpdateUser != null">last_update_user = #{lastUpdateUser},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
</trim>
|
||
|
|
where stock_id = #{stockId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteAppStockByStockId" parameterType="String">
|
||
|
|
delete from app_stock where stock_id = #{stockId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteAppStockByStockIds" parameterType="String">
|
||
|
|
delete from app_stock where stock_id in
|
||
|
|
<foreach item="stockId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{stockId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|