TdBWxConfigSMapper.xml 5.28 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.order.mapper.smapper.TdBWxConfigSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.order.domain.TdBWxConfig">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="appid" property="appid" jdbcType="VARCHAR"/>
        <result column="app_secret" property="appSecret" jdbcType="VARCHAR"/>
        <result column="is_encrypt_message" property="isEncryptMessage" jdbcType="INTEGER"/>
        <result column="encoding_aes_key" property="encodingAesKey" jdbcType="VARCHAR"/>
        <result column="mchid" property="mchid" jdbcType="INTEGER"/>
        <result column="pay_api_secret" property="payApiSecret" jdbcType="VARCHAR"/>
        <result column="data_state" property="dataState" jdbcType="INTEGER"/>
        <result column="is_pay_noCredit" property="isPayNocredit" jdbcType="INTEGER"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="create_op" property="createOp" jdbcType="INTEGER"/>
        <result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
        <result column="modify_op" property="modifyOp" jdbcType="INTEGER"/>
        <result column="modify_date" property="modifyDate" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
    id, appid, app_secret, is_encrypt_message, encoding_aes_key, mchid, pay_api_secret, 
    data_state, is_pay_noCredit, remark, create_op, create_date, modify_op, modify_date
  </sql>

    <select id="queryWxConfigByAppid" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM td_b_wx_config
        WHERE data_state = 1
        AND appid = #{appid}

    </select>

    <select id="queryAllWxConfigs" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM td_b_wx_config
        WHERE data_state = 1
    </select>

    <insert id="insertSelective" parameterType="com.zteits.order.domain.TdBWxConfig">
        <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
            SELECT LAST_INSERT_ID()
        </selectKey>
        insert into td_b_wx_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="appid != null">
                appid,
            </if>
            <if test="appSecret != null">
                app_secret,
            </if>
            <if test="isEncryptMessage != null">
                is_encrypt_message,
            </if>
            <if test="encodingAesKey != null">
                encoding_aes_key,
            </if>
            <if test="mchid != null">
                mchid,
            </if>
            <if test="payApiSecret != null">
                pay_api_secret,
            </if>
            <if test="dataState != null">
                data_state,
            </if>
            <if test="isPayNocredit != null">
                is_pay_noCredit,
            </if>
            <if test="certName != null">
                cert_name,
            </if>
            <if test="remark != null">
                remark,
            </if>
            <if test="createOp != null">
                create_op,
            </if>
            <if test="createDate != null">
                create_date,
            </if>
            <if test="modifyOp != null">
                modify_op,
            </if>
            <if test="modifyDate != null">
                modify_date,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="appid != null">
                #{appid,jdbcType=VARCHAR},
            </if>
            <if test="appSecret != null">
                #{appSecret,jdbcType=VARCHAR},
            </if>
            <if test="isEncryptMessage != null">
                #{isEncryptMessage,jdbcType=INTEGER},
            </if>
            <if test="encodingAesKey != null">
                #{encodingAesKey,jdbcType=VARCHAR},
            </if>
            <if test="mchid != null">
                #{mchid,jdbcType=INTEGER},
            </if>
            <if test="payApiSecret != null">
                #{payApiSecret,jdbcType=VARCHAR},
            </if>
            <if test="dataState != null">
                #{dataState,jdbcType=INTEGER},
            </if>
            <if test="isPayNocredit != null">
                #{isPayNocredit,jdbcType=INTEGER},
            </if>
            <if test="certName != null">
                #{certName,jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
                #{remark,jdbcType=VARCHAR},
            </if>
            <if test="createOp != null">
                #{createOp,jdbcType=INTEGER},
            </if>
            <if test="createDate != null">
                #{createDate,jdbcType=TIMESTAMP},
            </if>
            <if test="modifyOp != null">
                #{modifyOp,jdbcType=INTEGER},
            </if>
            <if test="modifyDate != null">
                #{modifyDate,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>

</mapper>