From af75ed87135a0f349886197a8233fb97ad5d92ce Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期六, 22 二月 2025 14:07:37 +0800 Subject: [PATCH] 新增修改,项目名项目码唯一验证 --- business/src/main/resources/mapper/ProjectInfoMapper.xml | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/business/src/main/resources/mapper/ProjectInfoMapper.xml b/business/src/main/resources/mapper/ProjectInfoMapper.xml index 2ab2752..f81ae05 100644 --- a/business/src/main/resources/mapper/ProjectInfoMapper.xml +++ b/business/src/main/resources/mapper/ProjectInfoMapper.xml @@ -232,4 +232,17 @@ <select id="queryById" resultType="com.ycl.domain.entity.ProjectInfo"> select * from t_project_info where id = #{id} and deleted = 0 </select> + + <resultMap id="pInfo" type="com.ycl.domain.entity.ProjectInfo"> + <id column="id" property="id"/> + </resultMap> + <select id="checkProjectNameAndIdIsUnique" resultMap="pInfo"> + select p.id from t_project_info p where p.project_name =#{name} + <if test="code !=null and code !=''"> + or p.project_code =#{code} + </if> + having p.id != #{id} + + </select> + </mapper> -- Gitblit v1.8.0