<?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.ruoyi.base.mapper.BaseInquiryMapper">
    
    <resultMap type="BaseInquiry" id="BaseInquiryResult">
        <result property="id"    column="id"    />
        <result property="company"    column="company"    />
        <result property="companyMust"    column="company_must"    />
        <result property="tel"    column="tel"    />
        <result property="telMust"    column="tel_must"    />
        <result property="title"    column="title"    />
        <result property="titleMust"    column="title_must"    />
        <result property="name"    column="name"    />
        <result property="nameMust"    column="name_must"    />
        <result property="content"    column="content"    />
        <result property="tenantId"    column="tenant_id"    />
        <result property="creator"    column="creator"    />
        <result property="createTime"    column="create_time"    />
        <result property="updater"    column="updater"    />
        <result property="updateTime"    column="update_time"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>

    <sql id="selectBaseInquiryVo">
        select id, company, company_must, tel, tel_must, title, title_must, name, name_must, content, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_inquiry
    </sql>

    <select id="queryListPage" parameterType="BaseInquiry" resultMap="BaseInquiryResult">
        <include refid="selectBaseInquiryVo"/>
        <where>
                        <if test="entity.company != null  and entity.company != ''"> and company = #{entity.company}</if>
                        <if test="entity.companyMust != null "> and company_must = #{entity.companyMust}</if>
                        <if test="entity.tel != null  and entity.tel != ''"> and tel = #{entity.tel}</if>
                        <if test="entity.telMust != null "> and tel_must = #{entity.telMust}</if>
                        <if test="entity.title != null  and entity.title != ''"> and title = #{entity.title}</if>
                        <if test="entity.titleMust != null "> and title_must = #{entity.titleMust}</if>
                        <if test="entity.name != null  and entity.name != ''"> and name like concat('%', #{entity.name}, '%')</if>
                        <if test="entity.nameMust != null  and entity.nameMust != ''"> and name_must = #{entity.nameMust}</if>
                        <if test="entity.content != null  and entity.content != ''"> and content = #{entity.content}</if>
                        <if test="entity.tenantId != null  and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
        </where>
    </select>
</mapper>