取货点和社区添加验证重复

This commit is contained in:
2023-03-25 15:02:58 +08:00
parent 1639e0ec9a
commit f302bb372e
10 changed files with 86 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ package com.zscat.mallplus.build.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zscat.mallplus.build.entity.BuildWuyeCompany;
import org.apache.ibatis.annotations.Param;
/**
* <p>
@@ -13,4 +14,7 @@ import com.zscat.mallplus.build.entity.BuildWuyeCompany;
*/
public interface BuildWuyeCompanyMapper extends BaseMapper<BuildWuyeCompany> {
int selectByName(String name);
int selectByNameAndId(@Param("name") String name, @Param("id") Long id);
}

View File

@@ -31,4 +31,8 @@ public interface BuildingCommunityMapper extends BaseMapper<BuildingCommunity> {
@Param("pageSize") Integer pageSize);
IPage<BuildingCommunity> pagerList(Page<BuildingCommunity> buildingCommunityPage, @Param(Constants.WRAPPER)QueryWrapper<BuildingCommunity> buildingCommunityQueryWrapper);
int selectByNameAndCompanyId(@Param("name") String name, @Param("companyId") Long companyId);
int selectByNameAndCompanyIdAndId(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
}

View File

@@ -0,0 +1,16 @@
<?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.zscat.mallplus.build.mapper.BuildWuyeCompanyMapper">
<select id="selectByName" resultType="int">
select count(*)
from build_wuye_company
where name = #{name}
</select>
<select id="selectByNameAndId" resultType="int">
select count(*)
from build_wuye_company
where name = #{name}
and id &lt;&gt; #{id}
</select>
</mapper>

View File

@@ -45,4 +45,12 @@
${ew.sqlSegment}
</where>
</select>
<select id="selectByNameAndCompanyId" resultType="int">
select count(*) from building_community where name = #{name} and company_id = #{companyId}
</select>
<select id="selectByNameAndCompanyIdAndId" resultType="int">
select count(*) from building_community where name = #{name} and company_id = #{companyId} and id &lt;&gt; #{id}
</select>
</mapper>