|
@@ -0,0 +1,91 @@
|
|
|
+<?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.framework.recovery.mapper.RecSaleInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="RecSaleInfo" id="RecSaleInfoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="saleName" column="sale_name" />
|
|
|
+ <result property="salePrice" column="sale_price" />
|
|
|
+ <result property="market" column="market" />
|
|
|
+ <result property="commodityId" column="commodity_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createDate" column="create_date" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateDate" column="update_date" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectRecSaleInfoVo">
|
|
|
+ select id, sale_name, sale_price, market, commodity_id, create_by, create_date, update_by, update_date from rec_sale_info
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectRecSaleInfoList" parameterType="RecSaleInfo" resultMap="RecSaleInfoResult">
|
|
|
+ <include refid="selectRecSaleInfoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="saleName != null and saleName != ''"> and sale_name like concat('%', #{saleName}, '%')</if>
|
|
|
+ <if test="salePrice != null and salePrice != ''"> and sale_price = #{salePrice}</if>
|
|
|
+ <if test="market != null and market != ''"> and market = #{market}</if>
|
|
|
+ <if test="commodityId != null and commodityId != ''"> and commodity_id = #{commodityId}</if>
|
|
|
+ <if test="createDate != null "> and create_date = #{createDate}</if>
|
|
|
+ <if test="updateDate != null "> and update_date = #{updateDate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectRecSaleInfoById" parameterType="Long" resultMap="RecSaleInfoResult">
|
|
|
+ <include refid="selectRecSaleInfoVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertRecSaleInfo" parameterType="RecSaleInfo">
|
|
|
+ insert into rec_sale_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="saleName != null">sale_name,</if>
|
|
|
+ <if test="salePrice != null">sale_price,</if>
|
|
|
+ <if test="market != null">market,</if>
|
|
|
+ <if test="commodityId != null">commodity_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createDate != null">create_date,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateDate != null">update_date,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="saleName != null">#{saleName},</if>
|
|
|
+ <if test="salePrice != null">#{salePrice},</if>
|
|
|
+ <if test="market != null">#{market},</if>
|
|
|
+ <if test="commodityId != null">#{commodityId},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createDate != null">#{createDate},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateDate != null">#{updateDate},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateRecSaleInfo" parameterType="RecSaleInfo">
|
|
|
+ update rec_sale_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="saleName != null">sale_name = #{saleName},</if>
|
|
|
+ <if test="salePrice != null">sale_price = #{salePrice},</if>
|
|
|
+ <if test="market != null">market = #{market},</if>
|
|
|
+ <if test="commodityId != null">commodity_id = #{commodityId},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createDate != null">create_date = #{createDate},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateDate != null">update_date = #{updateDate},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteRecSaleInfoById" parameterType="Long">
|
|
|
+ delete from rec_sale_info where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteRecSaleInfoByIds" parameterType="String">
|
|
|
+ delete from rec_sale_info where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|