TdCPushMsgMapper.xml 13.8 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.TdCPushMsgMapper">
  <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdCPushMsg">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cust_id" jdbcType="VARCHAR" property="custId" />
    <result column="msg_title" jdbcType="VARCHAR" property="msgTitle" />
    <result column="msg_content" jdbcType="VARCHAR" property="msgContent" />
    <result column="msg_type" jdbcType="INTEGER" property="msgType" />
    <result column="templete_id" jdbcType="VARCHAR" property="templeteId" />
    <result column="push_type" jdbcType="INTEGER" property="pushType" />
    <result column="return_type" jdbcType="INTEGER" property="returnType" />
    <result column="read_type" jdbcType="INTEGER" property="readType" />
    <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" />
    <result column="out_msg_no" jdbcType="VARCHAR" property="outMsgNo" />
  </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, cust_id, msg_title, msg_content, msg_type, templete_id, push_type, return_type, 
    read_type, data_state, create_empid, create_date, modfiy_empid, modfiy_date, out_msg_no
  </sql>
  <select id="selectByExample" parameterType="com.zteits.pay.domain.TdCPushMsgExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from td_c_push_msg
    <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_push_msg
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_c_push_msg
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.pay.domain.TdCPushMsgExample">
    delete from td_c_push_msg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.pay.domain.TdCPushMsg">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_push_msg (cust_id, msg_title, msg_content, 
      msg_type, templete_id, push_type, 
      return_type, read_type, data_state, 
      create_empid, create_date, modfiy_empid, 
      modfiy_date, out_msg_no)
    values (#{custId,jdbcType=VARCHAR}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR}, 
      #{msgType,jdbcType=INTEGER}, #{templeteId,jdbcType=VARCHAR}, #{pushType,jdbcType=INTEGER}, 
      #{returnType,jdbcType=INTEGER}, #{readType,jdbcType=INTEGER}, #{dataState,jdbcType=INTEGER}, 
      #{createEmpid,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, 
      #{modfiyDate,jdbcType=TIMESTAMP}, #{outMsgNo,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.pay.domain.TdCPushMsg">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_push_msg
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="custId != null">
        cust_id,
      </if>
      <if test="msgTitle != null">
        msg_title,
      </if>
      <if test="msgContent != null">
        msg_content,
      </if>
      <if test="msgType != null">
        msg_type,
      </if>
      <if test="templeteId != null">
        templete_id,
      </if>
      <if test="pushType != null">
        push_type,
      </if>
      <if test="returnType != null">
        return_type,
      </if>
      <if test="readType != null">
        read_type,
      </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>
      <if test="outMsgNo != null">
        out_msg_no,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="custId != null">
        #{custId,jdbcType=VARCHAR},
      </if>
      <if test="msgTitle != null">
        #{msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="msgContent != null">
        #{msgContent,jdbcType=VARCHAR},
      </if>
      <if test="msgType != null">
        #{msgType,jdbcType=INTEGER},
      </if>
      <if test="templeteId != null">
        #{templeteId,jdbcType=VARCHAR},
      </if>
      <if test="pushType != null">
        #{pushType,jdbcType=INTEGER},
      </if>
      <if test="returnType != null">
        #{returnType,jdbcType=INTEGER},
      </if>
      <if test="readType != null">
        #{readType,jdbcType=INTEGER},
      </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>
      <if test="outMsgNo != null">
        #{outMsgNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.pay.domain.TdCPushMsgExample" resultType="java.lang.Long">
    select count(*) from td_c_push_msg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_c_push_msg
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.custId != null">
        cust_id = #{record.custId,jdbcType=VARCHAR},
      </if>
      <if test="record.msgTitle != null">
        msg_title = #{record.msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="record.msgContent != null">
        msg_content = #{record.msgContent,jdbcType=VARCHAR},
      </if>
      <if test="record.msgType != null">
        msg_type = #{record.msgType,jdbcType=INTEGER},
      </if>
      <if test="record.templeteId != null">
        templete_id = #{record.templeteId,jdbcType=VARCHAR},
      </if>
      <if test="record.pushType != null">
        push_type = #{record.pushType,jdbcType=INTEGER},
      </if>
      <if test="record.returnType != null">
        return_type = #{record.returnType,jdbcType=INTEGER},
      </if>
      <if test="record.readType != null">
        read_type = #{record.readType,jdbcType=INTEGER},
      </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>
      <if test="record.outMsgNo != null">
        out_msg_no = #{record.outMsgNo,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_c_push_msg
    set id = #{record.id,jdbcType=BIGINT},
      cust_id = #{record.custId,jdbcType=VARCHAR},
      msg_title = #{record.msgTitle,jdbcType=VARCHAR},
      msg_content = #{record.msgContent,jdbcType=VARCHAR},
      msg_type = #{record.msgType,jdbcType=INTEGER},
      templete_id = #{record.templeteId,jdbcType=VARCHAR},
      push_type = #{record.pushType,jdbcType=INTEGER},
      return_type = #{record.returnType,jdbcType=INTEGER},
      read_type = #{record.readType,jdbcType=INTEGER},
      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},
      out_msg_no = #{record.outMsgNo,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.pay.domain.TdCPushMsg">
    update td_c_push_msg
    <set>
      <if test="custId != null">
        cust_id = #{custId,jdbcType=VARCHAR},
      </if>
      <if test="msgTitle != null">
        msg_title = #{msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="msgContent != null">
        msg_content = #{msgContent,jdbcType=VARCHAR},
      </if>
      <if test="msgType != null">
        msg_type = #{msgType,jdbcType=INTEGER},
      </if>
      <if test="templeteId != null">
        templete_id = #{templeteId,jdbcType=VARCHAR},
      </if>
      <if test="pushType != null">
        push_type = #{pushType,jdbcType=INTEGER},
      </if>
      <if test="returnType != null">
        return_type = #{returnType,jdbcType=INTEGER},
      </if>
      <if test="readType != null">
        read_type = #{readType,jdbcType=INTEGER},
      </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>
      <if test="outMsgNo != null">
        out_msg_no = #{outMsgNo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.pay.domain.TdCPushMsg">
    update td_c_push_msg
    set cust_id = #{custId,jdbcType=VARCHAR},
      msg_title = #{msgTitle,jdbcType=VARCHAR},
      msg_content = #{msgContent,jdbcType=VARCHAR},
      msg_type = #{msgType,jdbcType=INTEGER},
      templete_id = #{templeteId,jdbcType=VARCHAR},
      push_type = #{pushType,jdbcType=INTEGER},
      return_type = #{returnType,jdbcType=INTEGER},
      read_type = #{readType,jdbcType=INTEGER},
      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},
      out_msg_no = #{outMsgNo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>