<?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.cms.mapper.AiChatHistoryMapper">

    <select id="getList" parameterType="com.ruoyi.cms.domain.ai.AiChatHistory" resultType="com.ruoyi.cms.domain.ai.AiChatHistory">
        select * from ai_chat_history where del_flag='0'
        <if test="userId != null and userId != ''">
            and user_id = #{userId}
        </if>
        <if test="chatId != null and chatId != ''">
            and chat_id = #{chatId}
        </if>
        <if test="appId != null and appId != ''">
            and app_id = #{appId}
        </if>
        <if test="title != null and title != ''">
            and title like CONCAT('%',#{title},'%')
        </if>
        <if test="updateTime != null">
            and to_char(update_time,'yyyy-mm-dd') = to_char(#{updateTime},'yyyy-mm-dd')
        </if>
    </select>

</mapper>