sql
This commit is contained in:
@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.safety.domain.HseSafetyInspection;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
|
||||
/**
|
||||
* 安全巡检工单Mapper接口
|
||||
|
||||
@ -6,6 +6,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<select id="webPage" resultType="org.dromara.safety.domain.HseSafetyInspection">
|
||||
|
||||
SELECT t.*
|
||||
FROM hse_safety_inspection t
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
job_key,
|
||||
MAX(version) AS latest_version
|
||||
FROM hse_safety_inspection
|
||||
WHERE job_key IS NOT NULL
|
||||
AND version IS NOT NULL
|
||||
GROUP BY job_key
|
||||
) sub ON t.job_key = sub.job_key AND t.version = sub.latest_version
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user