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

    <resultMap id="infoMap" type="com.house365.beans.entity.DutyStaffEntity">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="userId" column="userId"/>
        <result property="onduty" column="onduty"/>
        <result property="updateTime" column="updateTime"/>
    </resultMap>

    <select id="queryByConditions" resultMap="infoMap" parameterType="map">
        SELECT
          *
        FROM duty_staff
        where 1 = 1
        <if test="onduty != null and onduty >= 0 ">
            AND onduty = #{onduty}
        </if>
        <if test="order != null and order >= 0 ">
            ORDER by updateTime DESC
        </if>
    </select>

</mapper>