Administrator
2018-11-30 1eedb9ac8c217ee2fd0b972367bdf8e37cda0865
收藏修改
3个文件已添加
155 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/CollectionGoodsV2Mapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/goods/CollectionGoodsV2.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/CollectionGoodsV2Mapper.xml 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/CollectionGoodsV2Mapper.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.dao.mybatis.goods;
import com.yeshi.fanli.goods.CollectionGoodsV2;
public interface CollectionGoodsV2Mapper {
    int deleteByPrimaryKey(Long id);
    int insert(CollectionGoodsV2 record);
    int insertSelective(CollectionGoodsV2 record);
    CollectionGoodsV2 selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(CollectionGoodsV2 record);
    int updateByPrimaryKey(CollectionGoodsV2 record);
}
fanli/src/main/java/com/yeshi/fanli/goods/CollectionGoodsV2.java
New file
@@ -0,0 +1,63 @@
package com.yeshi.fanli.goods;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@Table("yeshi_ec_collection_goods_v2")
public class CollectionGoodsV2 {
    @Column(name = "cg_id")
    private Long id;
    @Column(name = "cg_uid")
    private UserInfo userInfo;
    @Column(name = "cg_common_goods_id")
    private CommonGoods commonGoods;
    @Column(name = "cg_createtime")
    private Date createTime;
    @Column(name = "cg_updatetime")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public UserInfo getUserInfo() {
        return userInfo;
    }
    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }
    public CommonGoods getCommonGoods() {
        return commonGoods;
    }
    public void setCommonGoods(CommonGoods commonGoods) {
        this.commonGoods = commonGoods;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/goods/CollectionGoodsV2Mapper.xml
New file
@@ -0,0 +1,74 @@
<?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.yeshi.fanli.dao.mybatis.goods.CollectionGoodsV2Mapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.goods.CollectionGoodsV2">
        <id column="cg_id" property="id" jdbcType="BIGINT" />
        <result column="cg_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="cg_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <association property="userInfo" column="cg_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="cg_uid" property="id" jdbcType="BIGINT" />
        </association>
        <association property="commonGoods" column="cg_common_goods_id"
            javaType="com.yeshi.fanli.goods.CommonGoods"
            resultMap="com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper.BaseResultMap">
        </association>
    </resultMap>
    <sql id="Base_Column_List">cg_id,cg_uid,cg_common_goods_id,cg_createtime,cg_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_collection_goods_v2 where cg_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_collection_goods_v2 where cg_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.goods.CollectionGoodsV2"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_collection_goods_v2
        (cg_id,cg_uid,cg_common_goods_id,cg_createtime,cg_updatetime) values
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.goods.CollectionGoodsV2"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_collection_goods_v2
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">cg_id,</if>
            <if test="userInfo != null">cg_uid,</if>
            <if test="commonGoods != null">cg_common_goods_id,</if>
            <if test="createTime != null">cg_createtime,</if>
            <if test="updateTime != null">cg_updatetime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="commonGoods != null">#{commonGoods.id,jdbcType=BIGINT},</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.goods.CollectionGoodsV2">update
        yeshi_ec_collection_goods_v2 set cg_uid =
        #{userInfo.id,jdbcType=BIGINT},cg_common_goods_id =
        #{commonGoods.id,jdbcType=BIGINT},cg_createtime =
        #{createTime,jdbcType=TIMESTAMP},cg_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where cg_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.goods.CollectionGoodsV2">
        update yeshi_ec_collection_goods_v2
        <set>
            <if test="userInfo != null">cg_uid=#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="commonGoods != null">cg_common_goods_id=#{commonGoods.id,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">cg_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">cg_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where cg_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>