模糊搜索和时间区间搜索

    <!-- 账单编号 -->
            <if test="billListForm.code != null and billListForm.code != ''">
                AND a.code LIKE CONCAT('%',#{billListForm.code},'%')
            </if>
            <!-- 账单状态 -->
            <if test="billListForm.status != null and billListForm.status != ''">
                AND a.status = #{billListForm.status}
            </if>
            <!-- 起止时间 -->
            <if test="billListForm.beginDate  != null and billListForm.beginDate != ''">
                AND a.create_time  <![CDATA[   >=  #{billListForm.beginDate } ]]>
            </if>
            <if test="billListForm.endDate  != null and billListForm.endDate != ''">
                AND  a.create_time <![CDATA[   <= #{billListForm.endDate } ]]>
            </if>
        </where>   

原文地址:https://www.cnblogs.com/pai-da-xing/p/8065914.html