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