<?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.DutyStaffOtherMapper">

    <resultMap id="infoMap" type="com.house365.beans.entity.DutyStaffOtherEntity">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="userId" column="user_id"/>
        <result property="isDuty" column="is_duty"/>
        <result property="city" column="city"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>

    <select id="queryByConditions" resultMap="infoMap" parameterType="map">
        SELECT
           id,name,user_id,is_duty,city,update_time
        FROM duty_staff_other
        where 1 = 1
        <if test="isDuty != null and isDuty >= 0 ">
            AND is_duty = #{isDuty}
        </if>
        <if test="city != null and city != ''">
            AND city = #{city}
        </if>
    </select>

</mapper>