92 lines
4.8 KiB
XML
92 lines
4.8 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.AppGoodsMapper">
|
||
|
|
|
||
|
|
<resultMap type="AppGoods" id="AppGoodsResult">
|
||
|
|
<result property="goodsId" column="goods_id" />
|
||
|
|
<result property="goodsName" column="goods_name" />
|
||
|
|
<result property="goodsUnit" column="goods_unit" />
|
||
|
|
<result property="goodsType" column="goods_type" />
|
||
|
|
<result property="normalVehicleType" column="normal_vehicle_type" />
|
||
|
|
<result property="goodsStatus" column="goods_status" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
<result property="lastUpdateUser" column="last_update_user" />
|
||
|
|
<result property="lastUpdateTime" column="last_update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectAppGoodsVo">
|
||
|
|
select goods_id, goods_name, goods_unit, goods_type, normal_vehicle_type, goods_status, remark, last_update_user, last_update_time from app_goods
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectAppGoodsList" parameterType="AppGoods" resultMap="AppGoodsResult">
|
||
|
|
<include refid="selectAppGoodsVo"/>
|
||
|
|
<where>
|
||
|
|
<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="goodsType != null and goodsType != ''"> and goods_type = #{goodsType}</if>
|
||
|
|
<if test="normalVehicleType != null and normalVehicleType != ''"> and normal_vehicle_type = #{normalVehicleType}</if>
|
||
|
|
<if test="goodsStatus != null "> and goods_status = #{goodsStatus}</if>
|
||
|
|
<if test="lastUpdateUser != null and lastUpdateUser != ''"> and last_update_user = #{lastUpdateUser}</if>
|
||
|
|
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectAppGoodsByGoodsId" parameterType="String" resultMap="AppGoodsResult">
|
||
|
|
<include refid="selectAppGoodsVo"/>
|
||
|
|
where goods_id = #{goodsId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertAppGoods" parameterType="AppGoods">
|
||
|
|
insert into app_goods
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="goodsId != null">goods_id,</if>
|
||
|
|
<if test="goodsName != null">goods_name,</if>
|
||
|
|
<if test="goodsUnit != null and goodsUnit != ''">goods_unit,</if>
|
||
|
|
<if test="goodsType != null">goods_type,</if>
|
||
|
|
<if test="normalVehicleType != null">normal_vehicle_type,</if>
|
||
|
|
<if test="goodsStatus != null">goods_status,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="lastUpdateUser != null">last_update_user,</if>
|
||
|
|
<if test="lastUpdateTime != null">last_update_time,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="goodsId != null">#{goodsId},</if>
|
||
|
|
<if test="goodsName != null">#{goodsName},</if>
|
||
|
|
<if test="goodsUnit != null and goodsUnit != ''">#{goodsUnit},</if>
|
||
|
|
<if test="goodsType != null">#{goodsType},</if>
|
||
|
|
<if test="normalVehicleType != null">#{normalVehicleType},</if>
|
||
|
|
<if test="goodsStatus != null">#{goodsStatus},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="lastUpdateUser != null">#{lastUpdateUser},</if>
|
||
|
|
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateAppGoods" parameterType="AppGoods">
|
||
|
|
update app_goods
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="goodsName != null">goods_name = #{goodsName},</if>
|
||
|
|
<if test="goodsUnit != null and goodsUnit != ''">goods_unit = #{goodsUnit},</if>
|
||
|
|
<if test="goodsType != null">goods_type = #{goodsType},</if>
|
||
|
|
<if test="normalVehicleType != null">normal_vehicle_type = #{normalVehicleType},</if>
|
||
|
|
<if test="goodsStatus != null">goods_status = #{goodsStatus},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="lastUpdateUser != null">last_update_user = #{lastUpdateUser},</if>
|
||
|
|
<if test="lastUpdateTime != null">last_update_time = #{lastUpdateTime},</if>
|
||
|
|
</trim>
|
||
|
|
where goods_id = #{goodsId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteAppGoodsByGoodsId" parameterType="String">
|
||
|
|
delete from app_goods where goods_id = #{goodsId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteAppGoodsByGoodsIds" parameterType="String">
|
||
|
|
delete from app_goods where goods_id in
|
||
|
|
<foreach item="goodsId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{goodsId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|