<?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.goafanti.common.dao.PaymentLogMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PaymentLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="pid" jdbcType="INTEGER" property="pid" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="aid" jdbcType="VARCHAR" property="aid" />
    <result column="aname" jdbcType="VARCHAR" property="aname" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    id, pid, `status`, remarks, aid, aname, create_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    select 
    <include refid="Base_Column_List" />
    from payment_log
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    delete from payment_log
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.PaymentLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    insert into payment_log (id, pid, `status`, 
      remarks, aid, aname, 
      create_time)
    values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
      #{remarks,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{aname,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    insert into payment_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="pid != null">
        pid,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="aid != null">
        aid,
      </if>
      <if test="aname != null">
        aname,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="pid != null">
        #{pid,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="aid != null">
        #{aid,jdbcType=VARCHAR},
      </if>
      <if test="aname != null">
        #{aname,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PaymentLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    update payment_log
    <set>
      <if test="pid != null">
        pid = #{pid,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="aid != null">
        aid = #{aid,jdbcType=VARCHAR},
      </if>
      <if test="aname != null">
        aname = #{aname,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.goafanti.common.model.PaymentLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jul 20 09:16:06 CST 2021.
    -->
    update payment_log
    set pid = #{pid,jdbcType=INTEGER},
      `status` = #{status,jdbcType=INTEGER},
      remarks = #{remarks,jdbcType=VARCHAR},
      aid = #{aid,jdbcType=VARCHAR},
      aname = #{aname,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
  <select id="selectByPid" resultType="com.goafanti.organization.bo.OutPaymentLog">
	select id,pid,status,remarks,aid,aname,create_time createTime,
	date_format(create_time,'%Y-%m-%d %H:%i:%s')createTimes
	from payment_log where pid= #{id}
  </select>
  
    <insert id="insertBatch" parameterType="com.goafanti.common.model.Notice">
    insert into payment_log ( pid, `status`,remarks, aid, aname)
    values 
    <foreach collection="list" index="index" item="item" separator=",">
      (#{item}, #{status}, #{remarks}, #{aid}, #{aname} )
    </foreach>
  </insert>
</mapper>