<?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.miaxis.newgzpt.mapper.GzptSchPayConfigMapper">


    <resultMap type="GzptSchPayConfig" id="GzptSchPayConfigResult">
        <result property="id"    column="id"    />
        <result property="dqbh"    column="dqbh"    />
        <result property="dqmc"    column="dqmc"    />
        <result property="jxbh"    column="jxbh"    />
        <result property="jxmc"    column="jxmc"    />
        <result property="openTime"    column="open_time"    />
        <result property="isOpen"    column="is_open"    />
        <result property="sync"    column="sync"    />
        <result property="syncTime"    column="sync_time"    />
    </resultMap>


    <select id="getSchPayConfigByJxbh"  resultType="com.miaxis.newgzpt.domain.GzptSchPayConfig">
        select * from GZPT_SCH_PAY_CONFIG where jxbh =#{jxbh}
    </select>

    <select id="selectSchPayConfigList"  parameterType="com.miaxis.newgzpt.dto.GzptSchPayConfigDTO" resultMap="GzptSchPayConfigResult">
        select * from GZPT_SCH_PAY_CONFIG
        <where>
            <if test="isOpen != null"> and is_open = #{isOpen }</if>
            <if test="jxmc != null  and jxmc != ''"> and jxmc like '%' ||  #{jxmc,jdbcType=VARCHAR} || '%'</if>
            <if test="dqbh != null  and dqbh != ''"> and dqbh = #{dqbh}</if>
        </where>
    </select>


    <update id="updateSchPayConfigByJxbh" parameterType="com.miaxis.newgzpt.dto.GzptSchPayConfigUpDTO">
        update GZPT_SCH_PAY_CONFIG
        set OPEN_TIME = #{openTime,jdbcType=DATE}, IS_OPEN = #{isOpen} , SYNC = 0
        where jxbh =#{jxbh}
    </update>


</mapper>
