Commit 29357c18 authored by diaoruifeng's avatar diaoruifeng
parents 62b73e65 5acf550b
...@@ -6,4 +6,10 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -6,4 +6,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface OcpTenantExtentMapper extends BaseMapper<OcpTenantExtent>{ public interface OcpTenantExtentMapper extends BaseMapper<OcpTenantExtent>{
/**
*
* @param appCode
* @return
*/
int queryCount(String appCode);
} }
...@@ -50,8 +50,9 @@ public class AppRegisterServiceImpl implements AppRegisterService { ...@@ -50,8 +50,9 @@ public class AppRegisterServiceImpl implements AppRegisterService {
public ResponseVO addApp(AppRegisterDTO appRegisterDTO) { public ResponseVO addApp(AppRegisterDTO appRegisterDTO) {
int count = ocpTenantBaseMapper.queryCount(appRegisterDTO.getAppCode()); int count = ocpTenantBaseMapper.queryCount(appRegisterDTO.getAppCode());
if (count != 0) { int c = ocpTenantExtentMapper.queryCount(appRegisterDTO.getAppCode());
return ResponseVO.error("应用编码有重复"); if (count != 0 || c != 0) {
return ResponseVO.error("应用编码有重复/应用扩展表编码有重复");
} }
OcpTenantIocn ocpTenantIocn = new OcpTenantIocn(); OcpTenantIocn ocpTenantIocn = new OcpTenantIocn();
......
...@@ -13,13 +13,12 @@ ...@@ -13,13 +13,12 @@
from ocp_tenant_base base from ocp_tenant_base base
INNER JOIN ocp_tenant_iocn icon ON base.tenant_code = icon.code_no INNER JOIN ocp_tenant_iocn icon ON base.tenant_code = icon.code_no
INNER JOIN ocp_tenant_extent extent ON extent.tenant_code = base.tenant_code INNER JOIN ocp_tenant_extent extent ON extent.tenant_code = base.tenant_code
INNER JOIN ocp_tenant_group g ON g.tenant_group_code = base.tenant_group_code WHERE icon.iocn_type = 'tenant' and icon.iocn_kind is null and base.is_delete = '0'
WHERE icon.iocn_type = 'tenant' and icon.iocn_kind is null
<if test="dto.kind != null and dto.kind != ''"> <if test="dto.kind != null and dto.kind != ''">
and base.professional_kind like '${dto.kind}' and base.professional_kind like '${dto.kind}'
</if> </if>
<if test="dto.type != null and dto.type != ''"> <if test="dto.type != null and dto.type != ''">
and g.tenant_group_name like '${dto.type}' and base.tenant_group_code like '${dto.type}'
</if> </if>
</select> </select>
......
<?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.pms.ocp.mapper.OcpTenantExtentMapper">
<select id="queryCount" resultType="java.lang.Integer">
select count(0)
from ocp_tenant_extent
where tenant_code = #{appCode}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment