yj
2020-03-06 207dc8655711cddac2653e18b51e58a88dba2084
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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.user.UserComplaintMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserComplaint">
    <id column="ucp_id" property="id" jdbcType="BIGINT"/>
    <result column="ucp_content" property="content" jdbcType="VARCHAR"/>
    <result column="ucp_picture_list" property="pictureList" jdbcType="VARCHAR"/>
    <result column="ucp_create_time" property="createTime" jdbcType="TIMESTAMP"/>
  
      <association property="userInfo" column="ucp_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
          <id column="ucp_uid" property="id" jdbcType="BIGINT"/>
      </association>
  
  </resultMap>
  
  
  <sql id="Base_Column_List">ucp_id,ucp_uid,ucp_content,ucp_picture_list,ucp_create_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_complaint where ucp_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_complaint where ucp_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserComplaint" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_complaint (ucp_id,ucp_uid,ucp_content,ucp_picture_list,ucp_create_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{content,jdbcType=VARCHAR},#{pictureList,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserComplaint" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_complaint
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ucp_id,</if>
      <if test="userInfo != null">ucp_uid,</if>
      <if test="content != null">ucp_content,</if>
      <if test="pictureList != null">ucp_picture_list,</if>
      <if test="createTime != null">ucp_create_time,</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="content != null">#{content,jdbcType=VARCHAR},</if>
      <if test="pictureList != null">#{pictureList,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserComplaint">update yeshi_ec_user_complaint set ucp_uid = #{userInfo.id,jdbcType=BIGINT},ucp_content = #{content,jdbcType=VARCHAR},ucp_picture_list = #{pictureList,jdbcType=VARCHAR},ucp_create_time = #{createTime,jdbcType=TIMESTAMP} where ucp_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserComplaint">update yeshi_ec_user_complaint
    <set>
      <if test="userInfo != null">ucp_uid=#{userInfo.id,jdbcType=BIGINT},</if>
      <if test="content != null">ucp_content=#{content,jdbcType=VARCHAR},</if>
      <if test="pictureList != null">ucp_picture_list=#{pictureList,jdbcType=VARCHAR},</if>
      <if test="createTime != null">ucp_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where ucp_id = #{id,jdbcType=BIGINT}
  </update>
</mapper>