<?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.huiju.estateagents.property.dao.AnnouncementTelMapper">
    <select id="selectListByParams" resultType="com.huiju.estateagents.property.model.AnnouncementTel">
       SELECT t.*
        FROM
            tp_announcement_tel t
        WHERE t.org_id = #{announcementTel.orgId}
        and t.type = #{announcementTel.type}
        <if test="announcementTel.communityId != null">
            and t.community_id = #{announcementTel.communityId}
        </if>
        <if test="announcementTel.tel != null and announcementTel.tel != ''">
          AND t.tel like concat('%',#{announcementTel.tel},'%')
        </if>
        <if test="announcementTel.remark != null and announcementTel.remark != ''">
          AND t.remark like concat('%',#{announcementTel.remark},'%')
        </if>
        <if test="announcementTel.name != null and announcementTel.name != ''">
          AND t.name like concat('%',#{announcementTel.name},'%')
        </if>
        ORDER BY t.create_date desc
    </select>
</mapper>
