123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.cdu.lys.graduation.repository.dao.CartGoodsDOMapper" >
- <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.CartGoodsDO" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="goods_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="cart_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="add_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- </constructor>
- </resultMap>
- <sql id="Base_Column_List" >
- id, goods_id, cart_id, add_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from tb_cart_goods
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from tb_cart_goods
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.CartGoodsDO" >
- insert into tb_cart_goods (id, goods_id, cart_id,
- add_time)
- values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{cartId,jdbcType=INTEGER},
- #{addTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.CartGoodsDO" >
- insert into tb_cart_goods
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="goodsId != null" >
- goods_id,
- </if>
- <if test="cartId != null" >
- cart_id,
- </if>
- <if test="addTime != null" >
- add_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="goodsId != null" >
- #{goodsId,jdbcType=INTEGER},
- </if>
- <if test="cartId != null" >
- #{cartId,jdbcType=INTEGER},
- </if>
- <if test="addTime != null" >
- #{addTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.CartGoodsDO" >
- update tb_cart_goods
- <set >
- <if test="goodsId != null" >
- goods_id = #{goodsId,jdbcType=INTEGER},
- </if>
- <if test="cartId != null" >
- cart_id = #{cartId,jdbcType=INTEGER},
- </if>
- <if test="addTime != null" >
- add_time = #{addTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.CartGoodsDO" >
- update tb_cart_goods
- set goods_id = #{goodsId,jdbcType=INTEGER},
- cart_id = #{cartId,jdbcType=INTEGER},
- add_time = #{addTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|