New file |
| | |
| | | <?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> |