123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.juxiao.xchat.module.xbd.mapper.circle.MomentsPicMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.circle.MomentsPic" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="moments_id" property="momentsId" jdbcType="INTEGER" />
- <result column="pic" property="pic" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, moments_id, pic, create_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from moments_pic
- where id = #{id,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsPic" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moments_pic (moments_id, pic, create_time
- )
- values (#{momentsId,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsPic" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moments_pic
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="momentsId != null" >
- moments_id,
- </if>
- <if test="pic != null" >
- pic,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="momentsId != null" >
- #{momentsId,jdbcType=INTEGER},
- </if>
- <if test="pic != null" >
- #{pic,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsPic" >
- update moments_pic
- <set >
- <if test="momentsId != null" >
- moments_id = #{momentsId,jdbcType=INTEGER},
- </if>
- <if test="pic != null" >
- pic = #{pic,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsPic" >
- update moments_pic
- set moments_id = #{momentsId,jdbcType=INTEGER},
- pic = #{pic,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from moments_pic
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <select id="countByMomentsPic" resultType="java.lang.Integer">
- select count(*) from moments_pic where moments_id = #{momentsId}
- </select>
- <select id="selectMomentsPicByMomentsId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from moments_pic
- where moments_id = #{momentsId}
- </select>
- <delete id="deleteByMomentsId">
- delete from moments_pic where moments_id = #{momentsId}
- </delete>
- </mapper>
|