<?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.qmth.jkserver.dao.ExamRoomAddressDao">

    <delete id="deleteByExamCode">
        delete t from jk_exam_room_address t
        <where>
            <if test="examCode != null and examCode != ''">
                and t.exam_code = #{examCode}
            </if>
        </where>
    </delete>

    <select id="findByProvinceAndCity" resultType="java.util.Map">
        select t.place_code as placeCode,t.place_name as placeName,count(1) as count from jk_exam_room_address t
        <where>
            <if test="province != null and province != ''">
                and t.province = #{province}
            </if>
            <if test="city != null and city != ''">
                and t.city = #{city}
            </if>
        </where>
        group by t.place_code,t.place_name
        order by t.place_code
    </select>
</mapper>
