Commit ab13be97 by 陶光胜

联合商户查询修改

parent c86e7cbe
......@@ -20,5 +20,5 @@ public interface UnionEnterpriseApiService {
ServiceResponse<Void> updateStoreAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, String ...message);
ServiceResponse<List<Long>> listStoreResourceByEnterpriseId(Integer enterpriseId);
ServiceResponse<List<UnionEnterpriseDTO>> listStoreResourceByEnterpriseId(Integer enterpriseId);
}
package com.gic.auth.dao.mapper;
import com.gic.auth.dto.UnionEnterpriseDTO;
import com.gic.auth.entity.TabSysUnionEnterpriseResource;
import org.apache.ibatis.annotations.Param;
......@@ -63,6 +64,6 @@ public interface TabSysUnionEnterpriseResourceMapper {
@Param("resourceType") Integer resourceType,
@Param("authOrizationMessage") String authOrizationMessage);
List<Long> listResourceByEnterpriseIdAndType(@Param("enterpriseId") Integer enterpriseId,
@Param("type") int type);
List<UnionEnterpriseDTO> listResourceByEnterpriseIdAndType(@Param("enterpriseId") Integer enterpriseId,
@Param("type") int type);
}
\ No newline at end of file
package com.gic.auth.service;
import com.gic.auth.dto.UnionEnterpriseDTO;
import com.gic.auth.entity.TabSysUnionEnterpriseResource;
import java.util.List;
......@@ -13,5 +14,5 @@ public interface UnionEnterpriseResourceService {
void updateAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, Integer resourceType, String authOrizationMessage);
List<Long> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type);
List<UnionEnterpriseDTO> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type);
}
......@@ -2,6 +2,7 @@ package com.gic.auth.service.impl;
import com.gic.auth.constant.AuthorizationStatusEnum;
import com.gic.auth.dao.mapper.TabSysUnionEnterpriseResourceMapper;
import com.gic.auth.dto.UnionEnterpriseDTO;
import com.gic.auth.entity.TabSysUnionEnterpriseResource;
import com.gic.auth.service.UnionEnterpriseResourceService;
import com.gic.enterprise.constants.Constants;
......@@ -57,7 +58,7 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
}
@Override
public List<Long> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type) {
public List<UnionEnterpriseDTO> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type) {
return this.tabSysUnionEnterpriseResourceMapper.listResourceByEnterpriseIdAndType(enterpriseId, type);
}
}
......@@ -98,8 +98,8 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
}
@Override
public ServiceResponse<List<Long>> listStoreResourceByEnterpriseId(Integer enterpriseId) {
List<Long> longList = this.unionEnterpriseResourceService.listResourceByEnterpriseIdAndType(enterpriseId, ResourceTypeEnum.STORE_RESOURCE.getCode());
public ServiceResponse<List<UnionEnterpriseDTO>> listStoreResourceByEnterpriseId(Integer enterpriseId) {
List<UnionEnterpriseDTO> longList = this.unionEnterpriseResourceService.listResourceByEnterpriseIdAndType(enterpriseId, ResourceTypeEnum.STORE_RESOURCE.getCode());
return ServiceResponse.success(longList);
}
......
......@@ -182,12 +182,13 @@
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
</update>
<select id="listResourceByEnterpriseIdAndType" resultType="java.lang.Long">
<select id="listResourceByEnterpriseIdAndType" resultType="com.gic.auth.dto.UnionEnterpriseDTO">
select
resource
from tab_sys_union_enterprise_resource
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and resource_type = #{type}
and status = 1
t1.union_enterprise_id,t2.resource
from tab_sys_union_enterprise t1,tab_sys_union_enterprise_resource t2
where t1.enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and t1.union_id=t2.union_id
and t2.resource_type = #{type}
and t1.status = 1
</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