<?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.house365.ws.dao.mapper.CityConfigMapper">

    <resultMap id="infoMap" type="com.house365.beans.entity.CityCallConfig">
        <result property="id" column="id"/>
        <result property="city" column="city"/>
        <result property="isDelete" column="is_delete"/>
        <result property="createUser" column="create_user"/>
        <result property="createTime" column="create_time"/>
        <result property="updateUser" column="update_user"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>

    <insert id="save" parameterType="com.house365.beans.entity.CityCallConfig">
        INSERT INTO yx_message (
            city,
            is_delete,
            create_user,
            create_time,
            update_user,
            update_time
        )
        VALUES (
            #{city},
            #{isDelete},
            #{createUser},
            #{createTime},
            #{updateUser},
            #{updateTime}
        )
    </insert>

    <select id="queryByCity" resultMap="infoMap" parameterType="map">
        SELECT *
        FROM city_call_config
        where is_delete = 0
        AND city = #{city}
    </select>

    <delete id="delete" parameterType="Integer">
        delete FROM city_call_config
        where #{id} = #{id}
    </delete>

    <select id="getNoApproximateConfig" resultType="com.house365.beans.entity.ApproximateEntity" parameterType="map">
        select id,dic_key,dic_value, dic_name,city
        from dictionary
        where dic_key = #{dicKey}
    </select>


</mapper>