<?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="org.dromara.resource.mapper.ZjkSmsConfigMapper">

    <resultMap id="BaseResultMap" type="org.dromara.resource.domain.ZjkSmsConfig">
        <id property="id" column="ID" jdbcType="BIGINT"/>
        <result property="configName" column="config_name" jdbcType="VARCHAR"/>
        <result property="spId" column="sp_id" jdbcType="VARCHAR"/>
        <result property="spPassword" column="sp_password" jdbcType="VARCHAR"/>
        <result property="sendUrl" column="send_url" jdbcType="VARCHAR"/>
        <result property="serviceId" column="service_id" jdbcType="VARCHAR"/>
        <result property="priority" column="priority" jdbcType="VARCHAR"/>
        <result property="startFlag" column="start_flag" jdbcType="VARCHAR"/>
        <result property="createDept" column="create_dept" jdbcType="VARCHAR"/>
        <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
        <result property="createBy" column="CREATE_BY" jdbcType="BIGINT"/>
        <result property="createTime" column="CREATE_TIME" jdbcType="DATE"/>
        <result property="updateBy" column="UPDATE_BY" jdbcType="BIGINT"/>
        <result property="updateTime" column="UPDATE_TIME" jdbcType="DATE"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,config_name,sp_id,
        sp_password,send_url,service_id,
        priority,start_flag,create_dept,
        tenant_id,CREATE_BY,CREATE_TIME,
        UPDATE_BY,UPDATE_TIME
    </sql>
    <update id="updateSmsInfoByResultId">
        update zjk_sms_info
        set send_status = #{sendStatus},
            return_code= #{sendCode},
            return_msg= #{sendMsg},
            UPDATE_TIME=now()
        where status_id = #{resultId}
    </update>
    <select id="selectSmsConfig" resultType="org.dromara.resource.domain.ZjkSmsConfig">
        select *
        from zjk_sms_config
        where start_flag = 1
    </select>
</mapper>
