From 2cb6b4ca3b5f4db642aa2d4f70ab7e3640a853a9 Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期四, 13 三月 2025 14:47:54 +0800 Subject: [PATCH] 实验室资质bug解决 --- basic-server/src/main/resources/mapper/CertificationMapper.xml | 22 ++++++++-------------- 1 files changed, 8 insertions(+), 14 deletions(-) diff --git a/basic-server/src/main/resources/mapper/CertificationMapper.xml b/basic-server/src/main/resources/mapper/CertificationMapper.xml index bec4d63..35154d0 100644 --- a/basic-server/src/main/resources/mapper/CertificationMapper.xml +++ b/basic-server/src/main/resources/mapper/CertificationMapper.xml @@ -2,19 +2,13 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.ruoyi.basic.mapper.CertificationMapper"> <select id="getCertificationDetail" resultType="com.ruoyi.basic.pojo.Certification"> - select b.* - from ( select c.id,a.`name`, a.`code`,a.organization,a.explanation,a.first_issuance_date,a.latest_issuance_date,c.expire_time , c.image_url, - c.file_url FROM - (SELECT id,name,MIN(date_of_issuance) AS first_issuance_date, - MAX(date_of_issuance) AS latest_issuance_date, - c.`code`,c.organization,c.explanation - FROM - certification c - <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> - ${ew.customSqlSegment} - </if> - GROUP BY - name) a left join certification c on a.id=c.id - ) b + SELECT * FROM certification + <where> + create_time IN ( + SELECT MAX( create_time ) FROM certification WHERE create_time IS NOT NULL GROUP BY NAME ) + <if test="param.name != null and param.name != ''"> + AND name like concat('%',#{param.name},'%') + </if> + </where> </select> </mapper> -- Gitblit v1.9.3