Authored by caoyan

自助上架

package com.yohoufo.dal.product;
import org.apache.ibatis.annotations.Param;
import com.yohoufo.dal.product.model.ProductSelfShelves;
public interface ProductSelfShelvesMapper {
int deleteByPrimaryKey(Integer id);
int insert(ProductSelfShelves record);
int insertSelective(ProductSelfShelves record);
ProductSelfShelves selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ProductSelfShelves record);
int insert(@Param("record")ProductSelfShelves record);
int updateByPrimaryKey(ProductSelfShelves record);
}
\ No newline at end of file
... ...
package com.yohoufo.dal.product;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yohoufo.dal.product.model.ProductSelfShelvesPic;
public interface ProductSelfShelvesPicMapper {
int deleteByPrimaryKey(Integer id);
int insert(ProductSelfShelvesPic record);
int insertSelective(ProductSelfShelvesPic record);
int insertBatch(@Param("selfShelvesId")Integer selfShelvesId, @Param("imageList") List<String> imageList);
ProductSelfShelvesPic selectByPrimaryKey(Integer id);
... ...
... ... @@ -27,15 +27,15 @@
delete from product_self_shelves
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yohoufo.dal.product.model.ProductSelfShelves" >
insert into product_self_shelves (id, brand, product_name,
<insert id="insert" useGeneratedKeys="true" keyProperty="record.id" >
insert into product_self_shelves (brand, product_name,
price, sale_time, product_code,
status, uid, create_time,
uid, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{brand,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR},
#{price,jdbcType=DECIMAL}, #{saleTime,jdbcType=INTEGER}, #{productCode,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
#{updateTime,jdbcType=INTEGER})
values (#{record.brand,jdbcType=VARCHAR}, #{record.productName,jdbcType=VARCHAR},
#{record.price,jdbcType=DECIMAL}, #{record.saleTime,jdbcType=INTEGER}, #{record.productCode,jdbcType=VARCHAR},
#{record.uid,jdbcType=INTEGER}, #{record.createTime,jdbcType=INTEGER},
#{record.updateTime,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yohoufo.dal.product.model.ProductSelfShelves" >
insert into product_self_shelves
... ...
<?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.yohoufo.dal.product.ProductSelfShelvesPicMapper" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.ProductSelfShelvesPic" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.ProductSelfShelvesPic" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="self_shelves_id" property="selfShelvesId" jdbcType="INTEGER" />
<result column="picture_url" property="pictureUrl" jdbcType="VARCHAR" />
... ... @@ -19,37 +19,15 @@
delete from product_self_shelves_pic
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yohoufo.dal.product.model.ProductSelfShelvesPic" >
insert into product_self_shelves_pic (id, self_shelves_id, picture_url
)
values (#{id,jdbcType=INTEGER}, #{selfShelvesId,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.yohoufo.dal.product.model.ProductSelfShelvesPic" >
insert into product_self_shelves_pic
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="selfShelvesId != null" >
self_shelves_id,
</if>
<if test="pictureUrl != null" >
picture_url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="selfShelvesId != null" >
#{selfShelvesId,jdbcType=INTEGER},
</if>
<if test="pictureUrl != null" >
#{pictureUrl,jdbcType=VARCHAR},
</if>
</trim>
<insert id="insertBatch">
insert into product_self_shelves_pic (self_shelves_id, picture_url)
values
<foreach collection="imageList" item="item" index="index" separator=",">
(#{selfShelvesId,jdbcType=INTEGER}, #{item,jdbcType=VARCHAR})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.product.model.ProductSelfShelvesPic" >
update product_self_shelves_pic
<set >
... ...