<?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.community.huiju.dao.AnnouncementTelMapper">
    <select id="selectListByParams" resultType="com.community.huiju.model.AnnouncementTel">
       SELECT
            t.id,
            t.community_id AS communityId,
            t.NAME,
            t.tel,
            t.remark,
            t.update_date,
            u.user_name AS updateName
        FROM
            tp_announcement_tel t
            LEFT JOIN tp_user u ON t.update_user = u.id
        WHERE
            1 = 1
        AND t.community_id = #{announcementTel.communityId}
        <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>
    </select>
</mapper>
