<?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.jjh.ent.mapper.JMemorandumMapper">

    <select id="page" resultType="com.ruoyi.jjh.ent.entity.JMemorandum">
        select * from j_memorandum
        <where>
            <if test="req.name != null and req.name != '' ">
                 and name like concat('%',#{req.name},'%') or keywords like concat('%',#{req.name},'%')
            </if>
            <if test="req.startTime != null ">
                and create_time &gt;= #{req.startTime}
            </if>
            <if test="req.endTime != null">
                and create_time &lt;= #{req.endTime}
            </if>
        </where>
    </select>
    <select id="selectIdToAll" resultType="com.ruoyi.jjh.ent.entity.JMemorandum">
        select * from j_memorandum
        <where>
            <if test="req.name != null and req.name != '' ">
                and name like concat('%',#{req.name},'%') or keywords like concat('%',#{req.name},'%')
            </if>
            <if test="req.startTime != null ">
                and create_time &gt;= #{req.startTime}
            </if>
            <if test="req.endTime != null">
                and create_time &lt;= #{req.endTime}
            </if>
            and project_id = #{req.projectId}
        </where>
    </select>
</mapper>
