PayRecordsMapper.xml 11.1 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.sunyo.energy.location.dao.PayRecordsMapper">
    <resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayRecords">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="payFees" property="payfees" jdbcType="DECIMAL"/>
        <result column="payUserId" property="payuserid" jdbcType="INTEGER"/>
        <result column="payTime" property="paytime" jdbcType="TIMESTAMP"/>
        <result column="payLocationId" property="paylocationid" jdbcType="VARCHAR"/>
        <result column="payStatus" property="paystatus" jdbcType="BIT"/>
        <result column="payType" property="paytype" jdbcType="BIT"/>
        <result column="payFessType" property="payfesstype" jdbcType="BIT"/>
        <result column="orderNumber" property="ordernumber" jdbcType="VARCHAR"/>
        <result column="reamke1" property="reamke1" jdbcType="VARCHAR"/>
        <result column="reamke2" property="reamke2" jdbcType="VARCHAR"/>
        <result column="reamke3" property="reamke3" jdbcType="VARCHAR"/>
        <result column="reamke4" property="reamke4" jdbcType="VARCHAR"/>
        <result column="payUserName" property="payusername" jdbcType="VARCHAR"/>
        <result column="payLocationName" property="paylocationname" jdbcType="VARCHAR"/>
        <result column="payTypeAddress" property="paytypeaddress" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
    id, payFees, payUserId, payTime, payLocationId, payStatus, payType, payFessType, 
    orderNumber, reamke1, reamke2, reamke3, reamke4, payUserName, payLocationName, payTypeAddress
  </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from pay_records
        where id = #{id,jdbcType=INTEGER}
    </select>

    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from pay_records
        where reamke1 = '0'
        <if test="orderNumber != '' and orderNumber != null">
            and payLocationName = #{orderNumber,jdbcType=VARCHAR}
        </if>
        <if test="startTime != '' and startTime != null">
            and payTime &gt; #{startTime,jdbcType=VARCHAR}
        </if>
        <if test="endTime != '' and endTime != null">
            and payTime &lt; #{endTime,jdbcType=VARCHAR}
        </if>
        <if test="username != '' and username != null">
            and payLocationName = #{username,jdbcType=VARCHAR}
        </if>
        <if test="payType != '' and payType != null">
            and payType = #{payType, jdbcType=BIT}
        </if>
        <if test="paystatus != '' and paystatus != null">
            and payStatus = #{paystatus, jdbcType=BIT}
        </if>
        order by payTime desc
    </select>

    <select id="findOrderNumber" parameterType="string" resultType="string">
        select distinct payTypeAddress from pay_records where orderNumber = #{value, jdbcType=VARCHAR}
  </select>

    <select id="selectType" parameterType="string" resultType="boolean">
        select distinct payType from pay_records where orderNumber = #{value, jdbcType=VARCHAR}
  </select>

    <update id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    UPDATE  pay_records
    SET reamke1 = '1'
    where id = #{id,jdbcType=INTEGER}
  </update>

    <update id="updateStatus" parameterType="string">
    update pay_records
    set payStatus = 1
    where orderNumber = #{value, jdbcType=VARCHAR}
  </update>

    <insert id="insert" parameterType="com.sunyo.energy.location.model.PayRecords">
    insert into pay_records (id, payFees, payUserId, 
      payTime, payLocationId, payStatus, 
      payType, payFessType, orderNumber, 
      reamke1, reamke2, reamke3, 
      reamke4, payUserName, payLocationName, 
      payTypeAddress)
    values (#{id,jdbcType=INTEGER}, #{payfees,jdbcType=DECIMAL}, #{payuserid,jdbcType=INTEGER}, 
      #{paytime,jdbcType=TIMESTAMP}, #{paylocationid,jdbcType=VARCHAR}, #{paystatus,jdbcType=BIT},
      #{paytype,jdbcType=BIT}, #{payfesstype,jdbcType=BIT}, #{ordernumber,jdbcType=VARCHAR}, 
      #{reamke1,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR}, #{reamke3,jdbcType=VARCHAR}, 
      #{reamke4,jdbcType=VARCHAR}, #{payusername,jdbcType=VARCHAR}, #{paylocationname,jdbcType=VARCHAR}, 
      #{paytypeaddress,jdbcType=VARCHAR})
  </insert>
    <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayRecords">
        insert into pay_records
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="payfees != null">
                payFees,
            </if>
            <if test="payuserid != null">
                payUserId,
            </if>
            <if test="paytime != null">
                payTime,
            </if>
            <if test="paylocationid != null">
                payLocationId,
            </if>
            <if test="paystatus != null">
                payStatus,
            </if>
            <if test="paytype != null">
                payType,
            </if>
            <if test="payfesstype != null">
                payFessType,
            </if>
            <if test="ordernumber != null">
                orderNumber,
            </if>
            <if test="reamke1 != null">
                reamke1,
            </if>
            <if test="reamke2 != null">
                reamke2,
            </if>
            <if test="reamke3 != null">
                reamke3,
            </if>
            <if test="reamke4 != null">
                reamke4,
            </if>
            <if test="payusername != null">
                payUserName,
            </if>
            <if test="paylocationname != null">
                payLocationName,
            </if>
            <if test="paytypeaddress != null">
                payTypeAddress,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="payfees != null">
                #{payfees,jdbcType=DECIMAL},
            </if>
            <if test="payuserid != null">
                #{payuserid,jdbcType=INTEGER},
            </if>
            <if test="paytime != null">
                #{paytime,jdbcType=TIMESTAMP},
            </if>
            <if test="paylocationid != null">
                #{paylocationid,jdbcType=VARCHAR},
            </if>
            <if test="paystatus != null">
                #{paystatus,jdbcType=BIT},
            </if>
            <if test="paytype != null">
                #{paytype,jdbcType=BIT},
            </if>
            <if test="payfesstype != null">
                #{payfesstype,jdbcType=BIT},
            </if>
            <if test="ordernumber != null">
                #{ordernumber,jdbcType=VARCHAR},
            </if>
            <if test="reamke1 != null">
                #{reamke1,jdbcType=VARCHAR},
            </if>
            <if test="reamke2 != null">
                #{reamke2,jdbcType=VARCHAR},
            </if>
            <if test="reamke3 != null">
                #{reamke3,jdbcType=VARCHAR},
            </if>
            <if test="reamke4 != null">
                #{reamke4,jdbcType=VARCHAR},
            </if>
            <if test="payusername != null">
                #{payusername,jdbcType=VARCHAR},
            </if>
            <if test="paylocationname != null">
                #{paylocationname,jdbcType=VARCHAR},
            </if>
            <if test="paytypeaddress != null">
                #{paytypeaddress,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayRecords">
        update pay_records
        <set>
            <if test="payfees != null">
                payFees = #{payfees,jdbcType=DECIMAL},
            </if>
            <if test="payuserid != null">
                payUserId = #{payuserid,jdbcType=INTEGER},
            </if>
            <if test="paytime != null">
                payTime = #{paytime,jdbcType=TIMESTAMP},
            </if>
            <if test="paylocationid != null">
                payLocationId = #{paylocationid,jdbcType=VARCHAR},
            </if>
            <if test="paystatus != null">
                payStatus = #{paystatus,jdbcType=BIT},
            </if>
            <if test="paytype != null">
                payType = #{paytype,jdbcType=BIT},
            </if>
            <if test="payfesstype != null">
                payFessType = #{payfesstype,jdbcType=BIT},
            </if>
            <if test="ordernumber != null">
                orderNumber = #{ordernumber,jdbcType=VARCHAR},
            </if>
            <if test="reamke1 != null">
                reamke1 = #{reamke1,jdbcType=VARCHAR},
            </if>
            <if test="reamke2 != null">
                reamke2 = #{reamke2,jdbcType=VARCHAR},
            </if>
            <if test="reamke3 != null">
                reamke3 = #{reamke3,jdbcType=VARCHAR},
            </if>
            <if test="reamke4 != null">
                reamke4 = #{reamke4,jdbcType=VARCHAR},
            </if>
            <if test="payusername != null">
                payUserName = #{payusername,jdbcType=VARCHAR},
            </if>
            <if test="paylocationname != null">
                payLocationName = #{paylocationname,jdbcType=VARCHAR},
            </if>
            <if test="paytypeaddress != null">
                payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <!--  <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords" >-->
    <!--    update pay_records-->
    <!--    set payFees = #{payfees,jdbcType=DECIMAL},-->
    <!--      payUserId = #{payuserid,jdbcType=INTEGER},-->
    <!--      payTime = #{paytime,jdbcType=TIMESTAMP},-->
    <!--      payLocationId = #{paylocationid,jdbcType=INTEGER},-->
    <!--      payStatus = #{paystatus,jdbcType=BIT},-->
    <!--      payType = #{paytype,jdbcType=BIT},-->
    <!--      payFessType = #{payfesstype,jdbcType=BIT},-->
    <!--      orderNumber = #{ordernumber,jdbcType=VARCHAR},-->
    <!--      reamke1 = #{reamke1,jdbcType=VARCHAR},-->
    <!--      reamke2 = #{reamke2,jdbcType=VARCHAR},-->
    <!--      reamke3 = #{reamke3,jdbcType=VARCHAR},-->
    <!--      reamke4 = #{reamke4,jdbcType=VARCHAR},-->
    <!--      payUserName = #{payusername,jdbcType=VARCHAR},-->
    <!--      payLocationName = #{paylocationname,jdbcType=VARCHAR},-->
    <!--      payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR}-->
    <!--    where id = #{id,jdbcType=INTEGER}-->
    <!--  </update>-->
    <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords">
    update pay_records
    set
      reamke3 = #{reamke3,jdbcType=VARCHAR},
      payFessType = #{payfesstype,jdbcType=BIT}
    where orderNumber = #{ordernumber,jdbcType=VARCHAR}

  </update>
</mapper>