From e633a09a6e03ef22314699acf4fd5d9ab42a07ca Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 26 十二月 2018 15:36:41 +0800 Subject: [PATCH] 新版订单修改 --- fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml | 174 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 110 insertions(+), 64 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml index 2eafc00..3c7327c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml @@ -2,68 +2,114 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper"> - <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.CommonOrderGoods"> - <id column="cog_id" property="id" jdbcType="BIGINT"/> - <result column="cog_goods_id" property="goodsId" jdbcType="VARCHAR"/> - <result column="cog_title" property="title" jdbcType="VARCHAR"/> - <result column="cog_picture" property="picture" jdbcType="VARCHAR"/> - <result column="cog_price" property="price" jdbcType="DECIMAL"/> - <result column="cog_shop_id" property="shopId" jdbcType="BIGINT"/> - <result column="cog_shop_name" property="shopName" jdbcType="VARCHAR"/> - <result column="cog_shop_type" property="shopType" jdbcType="VARCHAR"/> - <result column="cog_state" property="state" jdbcType="INTEGER"/> - <result column="cog_create_time" property="createTime" jdbcType="TIMESTAMP"/> - <result column="cog_update_time" property="updateTime" jdbcType="TIMESTAMP"/> - </resultMap> - - <sql id="Base_Column_List">cog_id,cog_goods_id,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time</sql> - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select - <include refid="Base_Column_List"/>from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT}</delete> - <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order_goods (cog_id,cog_goods_id,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time) values (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> - <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order_goods - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null">cog_id,</if> - <if test="goodsId != null">cog_goods_id,</if> - <if test="title != null">cog_title,</if> - <if test="picture != null">cog_picture,</if> - <if test="price != null">cog_price,</if> - <if test="shopId != null">cog_shop_id,</if> - <if test="shopName != null">cog_shop_name,</if> - <if test="shopType != null">cog_shop_type,</if> - <if test="state != null">cog_state,</if> - <if test="createTime != null">cog_create_time,</if> - <if test="updateTime != null">cog_update_time,</if> - </trim>values - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null">#{id,jdbcType=BIGINT},</if> - <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if> - <if test="title != null">#{title,jdbcType=VARCHAR},</if> - <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> - <if test="price != null">#{price,jdbcType=DECIMAL},</if> - <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if> - <if test="shopName != null">#{shopName,jdbcType=VARCHAR},</if> - <if test="shopType != null">#{shopType,jdbcType=VARCHAR},</if> - <if test="state != null">#{state,jdbcType=INTEGER},</if> - <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> - <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> - </trim> - </insert> - <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update yeshi_ec_common_order_goods set cog_goods_id = #{goodsId,jdbcType=VARCHAR},cog_title = #{title,jdbcType=VARCHAR},cog_picture = #{picture,jdbcType=VARCHAR},cog_price = #{price,jdbcType=DECIMAL},cog_shop_id = #{shopId,jdbcType=BIGINT},cog_shop_name = #{shopName,jdbcType=VARCHAR},cog_shop_type = #{shopType,jdbcType=VARCHAR},cog_state = #{state,jdbcType=INTEGER},cog_create_time = #{createTime,jdbcType=TIMESTAMP},cog_update_time = #{updateTime,jdbcType=TIMESTAMP} where cog_id = #{id,jdbcType=BIGINT}</update> - <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update yeshi_ec_common_order_goods - <set> - <if test="goodsId != null">cog_goods_id=#{goodsId,jdbcType=VARCHAR},</if> - <if test="title != null">cog_title=#{title,jdbcType=VARCHAR},</if> - <if test="picture != null">cog_picture=#{picture,jdbcType=VARCHAR},</if> - <if test="price != null">cog_price=#{price,jdbcType=DECIMAL},</if> - <if test="shopId != null">cog_shop_id=#{shopId,jdbcType=BIGINT},</if> - <if test="shopName != null">cog_shop_name=#{shopName,jdbcType=VARCHAR},</if> - <if test="shopType != null">cog_shop_type=#{shopType,jdbcType=VARCHAR},</if> - <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if> - <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if> - <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> - </set> where cog_id = #{id,jdbcType=BIGINT} - </update> - + <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.CommonOrderGoods"> + <id column="cog_id" property="id" jdbcType="BIGINT" /> + <result column="cog_goods_id" property="goodsId" jdbcType="VARCHAR" /> + <result column="cog_goods_type" property="goodsType" jdbcType="INTEGER" /> + <result column="cog_title" property="title" jdbcType="VARCHAR" /> + <result column="cog_picture" property="picture" jdbcType="VARCHAR" /> + <result column="cog_price" property="price" jdbcType="DECIMAL" /> + <result column="cog_shop_id" property="shopId" jdbcType="BIGINT" /> + <result column="cog_shop_name" property="shopName" jdbcType="VARCHAR" /> + <result column="cog_shop_type" property="shopType" jdbcType="VARCHAR" /> + <result column="cog_state" property="state" jdbcType="INTEGER" /> + <result column="cog_create_time" property="createTime" + jdbcType="TIMESTAMP" /> + <result column="cog_update_time" property="updateTime" + jdbcType="TIMESTAMP" /> + </resultMap> + + <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time + </sql> + + <select id="selectByPrimaryKey" resultMap="BaseResultMap" + parameterType="java.lang.Long"> + select + <include refid="Base_Column_List" /> + from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} + </select> + + + <select id="listByGoodsIdAndGoodsType" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List" /> + from yeshi_ec_common_order_goods where cog_goods_id = #{goodsId} and + cog_goods_type=#{goodsType} + </select> + + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from + yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" + useGeneratedKeys="true" keyProperty="id">insert into + yeshi_ec_common_order_goods + (cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time) + values + (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) + </insert> + <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" + useGeneratedKeys="true" keyProperty="id"> + insert into yeshi_ec_common_order_goods + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">cog_id,</if> + <if test="goodsId != null">cog_goods_id,</if> + <if test="goodsType != null">cog_goods_type,</if> + <if test="title != null">cog_title,</if> + <if test="picture != null">cog_picture,</if> + <if test="price != null">cog_price,</if> + <if test="shopId != null">cog_shop_id,</if> + <if test="shopName != null">cog_shop_name,</if> + <if test="shopType != null">cog_shop_type,</if> + <if test="state != null">cog_state,</if> + <if test="createTime != null">cog_create_time,</if> + <if test="updateTime != null">cog_update_time,</if> + </trim> + values + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">#{id,jdbcType=BIGINT},</if> + <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if> + <if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if> + <if test="title != null">#{title,jdbcType=VARCHAR},</if> + <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> + <if test="price != null">#{price,jdbcType=DECIMAL},</if> + <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if> + <if test="shopName != null">#{shopName,jdbcType=VARCHAR},</if> + <if test="shopType != null">#{shopType,jdbcType=VARCHAR},</if> + <if test="state != null">#{state,jdbcType=INTEGER},</if> + <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> + <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> + </trim> + </insert> + <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update + yeshi_ec_common_order_goods set cog_goods_id = + #{goodsId,jdbcType=VARCHAR},cog_goods_type = + #{goodsType,jdbcType=INTEGER}cog_title = + #{title,jdbcType=VARCHAR},cog_picture = + #{picture,jdbcType=VARCHAR},cog_price = + #{price,jdbcType=DECIMAL},cog_shop_id = + #{shopId,jdbcType=BIGINT},cog_shop_name = + #{shopName,jdbcType=VARCHAR},cog_shop_type = + #{shopType,jdbcType=VARCHAR},cog_state = + #{state,jdbcType=INTEGER},cog_create_time = + #{createTime,jdbcType=TIMESTAMP},cog_update_time = + #{updateTime,jdbcType=TIMESTAMP} where cog_id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"> + update yeshi_ec_common_order_goods + <set> + <if test="goodsId != null">cog_goods_id=#{goodsId,jdbcType=VARCHAR},</if> + <if test="goodsType != null">cog_goods_type=#{goodsType,jdbcType=INTEGER},</if> + <if test="title != null">cog_title=#{title,jdbcType=VARCHAR},</if> + <if test="picture != null">cog_picture=#{picture,jdbcType=VARCHAR},</if> + <if test="price != null">cog_price=#{price,jdbcType=DECIMAL},</if> + <if test="shopId != null">cog_shop_id=#{shopId,jdbcType=BIGINT},</if> + <if test="shopName != null">cog_shop_name=#{shopName,jdbcType=VARCHAR},</if> + <if test="shopType != null">cog_shop_type=#{shopType,jdbcType=VARCHAR},</if> + <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if> + <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if> + <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> + </set> + where cog_id = #{id,jdbcType=BIGINT} + </update> + </mapper> -- Gitblit v1.8.0