报表模板名称唯一性校验优化

This commit is contained in:
gaoqr
2024-12-13 15:09:48 +08:00
parent b2934663f9
commit b57cf81de5
3 changed files with 33 additions and 31 deletions
@@ -1,16 +1,4 @@
<?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.cf.imes.module.report.dal.mysql.template.ReportTemplateMapper">
<select id="selectExistTemplateName" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM report_template
WHERE name = #{reqVO.name}
<if test="reqVO.id != null">
AND id != #{reqVO.id}
</if>
<if test="isSuperAdmin">
AND type = #{type}
</if>
</select>
</mapper>