123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?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.CartDOMapper" >
- <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.CartDO" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- </constructor>
- </resultMap>
- <sql id="Base_Column_List" >
- id, user_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from tb_cart
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from tb_cart
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.CartDO" >
- insert into tb_cart (id, user_id)
- values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.CartDO" >
- insert into tb_cart
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="userId != null" >
- user_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="userId != null" >
- #{userId,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.CartDO" >
- update tb_cart
- <set >
- <if test="userId != null" >
- user_id = #{userId,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.CartDO" >
- update tb_cart
- set user_id = #{userId,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|