|
@@ -0,0 +1,239 @@
|
|
|
+<?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.hcloud.microserver.system.bank.dao.ProductTypePriceMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
|
|
|
+ <id column="guid" jdbcType="CHAR" property="guid" />
|
|
|
+ <result column="price" jdbcType="DECIMAL" property="price" />
|
|
|
+ <result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
|
+ <result column="check_state" jdbcType="INTEGER" property="checkState" />
|
|
|
+ <result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
|
|
|
+ <result column="check_remark" jdbcType="VARCHAR" property="checkRemark" />
|
|
|
+ <result column="state" jdbcType="INTEGER" property="state" />
|
|
|
+ <result column="create_user" jdbcType="CHAR" property="createUser" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
|
|
|
+ <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
|
|
|
+ </resultMap>
|
|
|
+ <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ <result column="fk_product_type" jdbcType="LONGVARCHAR" property="fkProductType" />
|
|
|
+ <result column="type_name" jdbcType="LONGVARCHAR" property="typeName" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ guid, price, remark, check_state, check_time, check_remark, state, create_user, create_time,
|
|
|
+ modified_user, modified_time
|
|
|
+ </sql>
|
|
|
+ <sql id="Blob_Column_List">
|
|
|
+ fk_product_type, type_name
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ ,
|
|
|
+ <include refid="Blob_Column_List" />
|
|
|
+ from t_product_type_price
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ delete from t_product_type_price
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ insert into t_product_type_price (guid, price, remark,
|
|
|
+ check_state, check_time, check_remark,
|
|
|
+ state, create_user, create_time,
|
|
|
+ modified_user, modified_time, fk_product_type,
|
|
|
+ type_name)
|
|
|
+ values (#{guid,jdbcType=CHAR}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
|
|
|
+ #{checkState,jdbcType=INTEGER}, #{checkTime,jdbcType=TIMESTAMP}, #{checkRemark,jdbcType=VARCHAR},
|
|
|
+ #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}, #{fkProductType,jdbcType=LONGVARCHAR},
|
|
|
+ #{typeName,jdbcType=LONGVARCHAR})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ insert into t_product_type_price
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ guid,
|
|
|
+ </if>
|
|
|
+ <if test="price != null">
|
|
|
+ price,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark,
|
|
|
+ </if>
|
|
|
+ <if test="checkState != null">
|
|
|
+ check_state,
|
|
|
+ </if>
|
|
|
+ <if test="checkTime != null">
|
|
|
+ check_time,
|
|
|
+ </if>
|
|
|
+ <if test="checkRemark != null">
|
|
|
+ check_remark,
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ state,
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="modifiedUser != null">
|
|
|
+ modified_user,
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ modified_time,
|
|
|
+ </if>
|
|
|
+ <if test="fkProductType != null">
|
|
|
+ fk_product_type,
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ type_name,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ #{guid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="price != null">
|
|
|
+ #{price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkState != null">
|
|
|
+ #{checkState,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="checkTime != null">
|
|
|
+ #{checkTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkRemark != null">
|
|
|
+ #{checkRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ #{state,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ #{createUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedUser != null">
|
|
|
+ #{modifiedUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="fkProductType != null">
|
|
|
+ #{fkProductType,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ #{typeName,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ update t_product_type_price
|
|
|
+ <set>
|
|
|
+ <if test="price != null">
|
|
|
+ price = #{price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkState != null">
|
|
|
+ check_state = #{checkState,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="checkTime != null">
|
|
|
+ check_time = #{checkTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkRemark != null">
|
|
|
+ check_remark = #{checkRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user = #{createUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedUser != null">
|
|
|
+ modified_user = #{modifiedUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="fkProductType != null">
|
|
|
+ fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ type_name = #{typeName,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ update t_product_type_price
|
|
|
+ set price = #{price,jdbcType=DECIMAL},
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ check_state = #{checkState,jdbcType=INTEGER},
|
|
|
+ check_time = #{checkTime,jdbcType=TIMESTAMP},
|
|
|
+ check_remark = #{checkRemark,jdbcType=VARCHAR},
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ create_user = #{createUser,jdbcType=CHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ modified_user = #{modifiedUser,jdbcType=CHAR},
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
|
|
|
+ type_name = #{typeName,jdbcType=LONGVARCHAR}
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
|
|
|
+ update t_product_type_price
|
|
|
+ set price = #{price,jdbcType=DECIMAL},
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ check_state = #{checkState,jdbcType=INTEGER},
|
|
|
+ check_time = #{checkTime,jdbcType=TIMESTAMP},
|
|
|
+ check_remark = #{checkRemark,jdbcType=VARCHAR},
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ create_user = #{createUser,jdbcType=CHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ modified_user = #{modifiedUser,jdbcType=CHAR},
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 查询列表 lym -->
|
|
|
+ <select id="selectList" parameterType="com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm" resultMap="ResultMapWithBLOBs">
|
|
|
+ SELECT <include refid="Base_Column_List"/>,<include refid="Blob_Column_List"/> FROM t_product_type_price
|
|
|
+ WHERE state = 1
|
|
|
+ <if test="typeName != null">
|
|
|
+ AND type_name LIKE CONCAT("%",#{typeName,jdbcType=LONGVARCHAR},"%)"
|
|
|
+ </if>
|
|
|
+ <if test="checkState != null">
|
|
|
+ AND check_state = #{checkState,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="checkTime != null">
|
|
|
+ AND check_time = #{checkTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据定价修改商品价格 lym -->
|
|
|
+ <update id="updateGoodsInfoPrice" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
|
|
|
+ UPDATE t_goods_info
|
|
|
+ SET price = #{price,jdbcType=DECIMAL}
|
|
|
+ WHERE guid IN
|
|
|
+ ( SELECT tmp.guid FROM(SELECT a.guid,a.price,c.fk_product_type FROM t_goods_info a
|
|
|
+ LEFT JOIN t_goods_detail b ON a.guid = b.fk_goods_guid
|
|
|
+ LEFT JOIN t_product_info c ON b.fk_product_guid = c.guid
|
|
|
+ WHERE a.state = 1 AND b.state = 1 AND c.state = 1
|
|
|
+ AND FIND_IN_SET(c.fk_product_type,#{fkProductType,jdbcType=LONGVARCHAR})
|
|
|
+ ) tmp
|
|
|
+ )
|
|
|
+ </update>
|
|
|
+</mapper>
|