无关风月
2025-02-21 694128f7b11bd27c2c7dd3869c3ae50926cb9b6b
ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml
@@ -70,5 +70,47 @@
        </if>
        AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
    </select>
    <select id="examineList" resultType="com.ruoyi.system.vo.ExamineVO">
        select t1.* from t_contract t1
        <where>
            <if test="query.status == 1">
                AND t1.status = 2
            </if>
            <if test="query.status == 2">
                AND (t1.status !=1 and t1.status !=2)
            </if>
            <if test="query.status == 3">
                AND t1.create_by = #{query.userName}
            </if>
            <if test="query.time != null and query.time != ''">
                <choose>
                    <when test="query.time == 1">
                        AND t1.create_time &gt;= DATE_SUB(NOW(), INTERVAL 1 DAY)
                    </when>
                    <when test="query.time == 2">
                        AND t1.create_time &gt;= DATE_SUB(NOW(), INTERVAL 7 DAY)
                    </when>
                    <when test="query.time == 3">
                        AND t1.create_time &gt;= DATE_SUB(NOW(), INTERVAL 30 DAY)
                    </when>
                </choose>
            </if>
        </where>
        <choose>
            <when test="query.sort != null and query.sort != ''">
                <choose>
                    <when test="query.sort == 1">
                        ORDER BY t1.create_time DESC
                    </when>
                    <when test="query.sort == 2">
                        ORDER BY t1.create_time ASC
                    </when>
                </choose>
            </when>
            <otherwise>
                ORDER BY t1.create_time DESC
            </otherwise>
        </choose>
    </select>
</mapper>