|
@@ -0,0 +1,128 @@
|
|
|
+<?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.yijia.integral.mapper.IntegralWaresMapper">
|
|
|
+
|
|
|
+ <resultMap type="IntegralWares" id="IntegralWaresResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="waresType" column="wares_type" />
|
|
|
+ <result property="waresName" column="wares_name" />
|
|
|
+ <result property="saleIntegral" column="sale_integral" />
|
|
|
+ <result property="waresPic" column="wares_pic" />
|
|
|
+ <result property="waresDetail" column="wares_detail" />
|
|
|
+ <result property="waresCount" column="wares_count" />
|
|
|
+ <result property="waresOutCount" column="wares_out_count" />
|
|
|
+ <result property="waresStatus" column="wares_status" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createName" column="create_name" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateName" column="update_name" />
|
|
|
+ <result property="stationId" column="station_id" />
|
|
|
+ <result property="stationName" column="station_name" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectIntegralWaresVo">
|
|
|
+ select id, wares_type, wares_name, sale_integral, wares_pic, wares_detail, wares_count, wares_out_count, wares_status, create_time, create_by, create_name, update_time, update_by, update_name, station_id, station_name from integral_wares
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectIntegralWaresList" parameterType="IntegralWares" resultMap="IntegralWaresResult">
|
|
|
+ <include refid="selectIntegralWaresVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="waresType != null and waresType != ''"> and wares_type = #{waresType}</if>
|
|
|
+ <if test="waresName != null and waresName != ''"> and wares_name like concat('%', #{waresName}, '%')</if>
|
|
|
+ <if test="saleIntegral != null "> and sale_integral = #{saleIntegral}</if>
|
|
|
+ <if test="waresPic != null and waresPic != ''"> and wares_pic = #{waresPic}</if>
|
|
|
+ <if test="waresDetail != null and waresDetail != ''"> and wares_detail = #{waresDetail}</if>
|
|
|
+ <if test="waresCount != null "> and wares_count = #{waresCount}</if>
|
|
|
+ <if test="waresOutCount != null "> and wares_out_count = #{waresOutCount}</if>
|
|
|
+ <if test="waresStatus != null and waresStatus != ''"> and wares_status = #{waresStatus}</if>
|
|
|
+ <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
|
|
|
+ <if test="updateName != null and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
|
|
|
+ <if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
+ <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectIntegralWaresById" parameterType="Long" resultMap="IntegralWaresResult">
|
|
|
+ <include refid="selectIntegralWaresVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertIntegralWares" parameterType="IntegralWares" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into integral_wares
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="waresType != null">wares_type,</if>
|
|
|
+ <if test="waresName != null">wares_name,</if>
|
|
|
+ <if test="saleIntegral != null">sale_integral,</if>
|
|
|
+ <if test="waresPic != null">wares_pic,</if>
|
|
|
+ <if test="waresDetail != null">wares_detail,</if>
|
|
|
+ <if test="waresCount != null">wares_count,</if>
|
|
|
+ <if test="waresOutCount != null">wares_out_count,</if>
|
|
|
+ <if test="waresStatus != null">wares_status,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createName != null">create_name,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateName != null">update_name,</if>
|
|
|
+ <if test="stationId != null">station_id,</if>
|
|
|
+ <if test="stationName != null">station_name,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="waresType != null">#{waresType},</if>
|
|
|
+ <if test="waresName != null">#{waresName},</if>
|
|
|
+ <if test="saleIntegral != null">#{saleIntegral},</if>
|
|
|
+ <if test="waresPic != null">#{waresPic},</if>
|
|
|
+ <if test="waresDetail != null">#{waresDetail},</if>
|
|
|
+ <if test="waresCount != null">#{waresCount},</if>
|
|
|
+ <if test="waresOutCount != null">#{waresOutCount},</if>
|
|
|
+ <if test="waresStatus != null">#{waresStatus},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createName != null">#{createName},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateName != null">#{updateName},</if>
|
|
|
+ <if test="stationId != null">#{stationId},</if>
|
|
|
+ <if test="stationName != null">#{stationName},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateIntegralWares" parameterType="IntegralWares">
|
|
|
+ update integral_wares
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="waresType != null">wares_type = #{waresType},</if>
|
|
|
+ <if test="waresName != null">wares_name = #{waresName},</if>
|
|
|
+ <if test="saleIntegral != null">sale_integral = #{saleIntegral},</if>
|
|
|
+ <if test="waresPic != null">wares_pic = #{waresPic},</if>
|
|
|
+ <if test="waresDetail != null">wares_detail = #{waresDetail},</if>
|
|
|
+ <if test="waresCount != null">wares_count = #{waresCount},</if>
|
|
|
+ <if test="waresOutCount != null">wares_out_count = #{waresOutCount},</if>
|
|
|
+ <if test="waresStatus != null">wares_status = #{waresStatus},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createName != null">create_name = #{createName},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateName != null">update_name = #{updateName},</if>
|
|
|
+ <if test="stationId != null">station_id = #{stationId},</if>
|
|
|
+ <if test="stationName != null">station_name = #{stationName},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteIntegralWaresById" parameterType="Long">
|
|
|
+ delete from integral_wares where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteIntegralWaresByIds" parameterType="String">
|
|
|
+ delete from integral_wares where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|