TdCCustSuggestDetailMapper.xml 15 KB
<?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.zteits.pay.mapper.TdCCustSuggestDetailMapper">
  <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdCCustSuggestDetail">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="suggest_id" jdbcType="VARCHAR" property="suggestId" />
    <result column="user_type" jdbcType="INTEGER" property="userType" />
    <result column="user_code" jdbcType="VARCHAR" property="userCode" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="feedback_code" jdbcType="INTEGER" property="feedbackCode" />
    <result column="suggest_answer" jdbcType="VARCHAR" property="suggestAnswer" />
    <result column="suggest_img_url1" jdbcType="VARCHAR" property="suggestImgUrl1" />
    <result column="suggest_img_url2" jdbcType="VARCHAR" property="suggestImgUrl2" />
    <result column="suggest_img_url3" jdbcType="VARCHAR" property="suggestImgUrl3" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, suggest_id, user_type, user_code, user_name, feedback_code, suggest_answer, suggest_img_url1, 
    suggest_img_url2, suggest_img_url3, remark, data_state, create_empid, create_date, 
    modfiy_empid, modfiy_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.pay.domain.TdCCustSuggestDetailExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from td_c_cust_suggest_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from td_c_cust_suggest_detail
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_c_cust_suggest_detail
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.pay.domain.TdCCustSuggestDetailExample">
    delete from td_c_cust_suggest_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.pay.domain.TdCCustSuggestDetail">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_cust_suggest_detail (suggest_id, user_type, user_code, 
      user_name, feedback_code, suggest_answer, 
      suggest_img_url1, suggest_img_url2, suggest_img_url3, 
      remark, data_state, create_empid, 
      create_date, modfiy_empid, modfiy_date
      )
    values (#{suggestId,jdbcType=VARCHAR}, #{userType,jdbcType=INTEGER}, #{userCode,jdbcType=VARCHAR}, 
      #{userName,jdbcType=VARCHAR}, #{feedbackCode,jdbcType=INTEGER}, #{suggestAnswer,jdbcType=VARCHAR}, 
      #{suggestImgUrl1,jdbcType=VARCHAR}, #{suggestImgUrl2,jdbcType=VARCHAR}, #{suggestImgUrl3,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.pay.domain.TdCCustSuggestDetail">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_cust_suggest_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="suggestId != null">
        suggest_id,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="userCode != null">
        user_code,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="feedbackCode != null">
        feedback_code,
      </if>
      <if test="suggestAnswer != null">
        suggest_answer,
      </if>
      <if test="suggestImgUrl1 != null">
        suggest_img_url1,
      </if>
      <if test="suggestImgUrl2 != null">
        suggest_img_url2,
      </if>
      <if test="suggestImgUrl3 != null">
        suggest_img_url3,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="suggestId != null">
        #{suggestId,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=INTEGER},
      </if>
      <if test="userCode != null">
        #{userCode,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="feedbackCode != null">
        #{feedbackCode,jdbcType=INTEGER},
      </if>
      <if test="suggestAnswer != null">
        #{suggestAnswer,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl1 != null">
        #{suggestImgUrl1,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl2 != null">
        #{suggestImgUrl2,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl3 != null">
        #{suggestImgUrl3,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.pay.domain.TdCCustSuggestDetailExample" resultType="java.lang.Long">
    select count(*) from td_c_cust_suggest_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_c_cust_suggest_detail
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.suggestId != null">
        suggest_id = #{record.suggestId,jdbcType=VARCHAR},
      </if>
      <if test="record.userType != null">
        user_type = #{record.userType,jdbcType=INTEGER},
      </if>
      <if test="record.userCode != null">
        user_code = #{record.userCode,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.feedbackCode != null">
        feedback_code = #{record.feedbackCode,jdbcType=INTEGER},
      </if>
      <if test="record.suggestAnswer != null">
        suggest_answer = #{record.suggestAnswer,jdbcType=VARCHAR},
      </if>
      <if test="record.suggestImgUrl1 != null">
        suggest_img_url1 = #{record.suggestImgUrl1,jdbcType=VARCHAR},
      </if>
      <if test="record.suggestImgUrl2 != null">
        suggest_img_url2 = #{record.suggestImgUrl2,jdbcType=VARCHAR},
      </if>
      <if test="record.suggestImgUrl3 != null">
        suggest_img_url3 = #{record.suggestImgUrl3,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createEmpid != null">
        create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyEmpid != null">
        modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyDate != null">
        modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_c_cust_suggest_detail
    set id = #{record.id,jdbcType=BIGINT},
      suggest_id = #{record.suggestId,jdbcType=VARCHAR},
      user_type = #{record.userType,jdbcType=INTEGER},
      user_code = #{record.userCode,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      feedback_code = #{record.feedbackCode,jdbcType=INTEGER},
      suggest_answer = #{record.suggestAnswer,jdbcType=VARCHAR},
      suggest_img_url1 = #{record.suggestImgUrl1,jdbcType=VARCHAR},
      suggest_img_url2 = #{record.suggestImgUrl2,jdbcType=VARCHAR},
      suggest_img_url3 = #{record.suggestImgUrl3,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.pay.domain.TdCCustSuggestDetail">
    update td_c_cust_suggest_detail
    <set>
      <if test="suggestId != null">
        suggest_id = #{suggestId,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=INTEGER},
      </if>
      <if test="userCode != null">
        user_code = #{userCode,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="feedbackCode != null">
        feedback_code = #{feedbackCode,jdbcType=INTEGER},
      </if>
      <if test="suggestAnswer != null">
        suggest_answer = #{suggestAnswer,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl1 != null">
        suggest_img_url1 = #{suggestImgUrl1,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl2 != null">
        suggest_img_url2 = #{suggestImgUrl2,jdbcType=VARCHAR},
      </if>
      <if test="suggestImgUrl3 != null">
        suggest_img_url3 = #{suggestImgUrl3,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.pay.domain.TdCCustSuggestDetail">
    update td_c_cust_suggest_detail
    set suggest_id = #{suggestId,jdbcType=VARCHAR},
      user_type = #{userType,jdbcType=INTEGER},
      user_code = #{userCode,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      feedback_code = #{feedbackCode,jdbcType=INTEGER},
      suggest_answer = #{suggestAnswer,jdbcType=VARCHAR},
      suggest_img_url1 = #{suggestImgUrl1,jdbcType=VARCHAR},
      suggest_img_url2 = #{suggestImgUrl2,jdbcType=VARCHAR},
      suggest_img_url3 = #{suggestImgUrl3,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>