Commit a531ebea authored by xxxxxwwwww's avatar xxxxxwwwww

修改

parent 7feab2ab
......@@ -9,10 +9,16 @@ import java.util.List;
public interface OcpTenantBaseMapper extends BaseMapper<OcpTenantBase> {
OcpTenantBase updataIsDelect(String objId,Short isDelete);
OcpTenantBase updataIsDelect(String objId, Short isDelete);
List<OcpTenantGroupIocnDto> selectAlls();
/**
* 查询数据库中是否有现有应用编码
*
* @param appCode
* @return
*/
int queryCount(String appCode);
}
......@@ -27,7 +27,7 @@ public class AppRegisterDTO {
@ApiModelProperty("应用图标")
@NotBlank(message = "应用图标不能为空", groups = CreateGroups.class)
// @NotBlank(message = "应用图标不能为空", groups = CreateGroups.class)
private byte[] imgUrl;
@ApiModelProperty("应用名称")
......
......@@ -19,7 +19,7 @@ public class ImgDTO {
private String tenantCode;
@ApiModelProperty(value = "应用预览url")
@NotBlank(message = "应用预览url不能为空", groups = CreateGroups.class)
// @NotBlank(message = "应用预览url不能为空", groups = CreateGroups.class)
private byte[] img;
public String getTenantCode() {
......
......@@ -49,6 +49,11 @@ public class AppRegisterServiceImpl implements AppRegisterService {
@Override
public ResponseVO addApp(AppRegisterDTO appRegisterDTO) {
int count = ocpTenantBaseMapper.queryCount(appRegisterDTO.getAppCode());
if (count != 0) {
return ResponseVO.error("应用编码有重复");
}
OcpTenantIocn ocpTenantIocn = new OcpTenantIocn();
ocpTenantIocn.setIocnType("tenant");
ocpTenantIocn.setCodeNo(appRegisterDTO.getAppCode());
......
<?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.OcpTenantBaseMapper" >
<mapper namespace="com.pms.ocp.mapper.OcpTenantBaseMapper">
<select id="getOtbList" resultType="com.pms.ocp.model.entity.OcpTenantBase">
select * from ocp_tenant_base otb
LEFT JOIN ocp_tenant_extent ote
on otb.tenant_code = ote.tenant_code
select *
from ocp_tenant_base otb
LEFT JOIN ocp_tenant_extent ote
on otb.tenant_code = ote.tenant_code
where otb.obj_id = #{objId}
</select>
<select id="updataIsDelect" resultType="com.pms.ocp.model.entity.OcpTenantBase">
UPDATE ocp_tenant_base SET is_delete = #{isDelete} WHERE obj_id = #{objId};
UPDATE ocp_tenant_base
SET is_delete = #{isDelete}
WHERE obj_id = #{objId};
</select>
<select id="selectAlls" resultType="com.pms.ocp.model.dto.OcpTenantGroupIocnDto">
SELECT * FROM ocp_tenant_base AS base ,ocp_tenant_extent AS extent,ocp_tenant_iocn as iocn
WHERE base.tenant_code = extent.tenant_code and base.tenant_code = code_no and iocn.iocn_kind is null ORDER BY base.tenant_mtime DESC;
SELECT *
FROM ocp_tenant_base AS base,
ocp_tenant_extent AS extent,
ocp_tenant_iocn as iocn
WHERE base.tenant_code = extent.tenant_code
and base.tenant_code = code_no
and iocn.iocn_kind is null
ORDER BY base.tenant_mtime DESC;
</select>
<select id="queryCount" resultType="java.lang.Integer">
select count(0)
from ocp_tenant_base
where tenant_code = #{appCode}
</select>
</mapper>
\ No newline at end of file
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