Commit f0416b4d by zhiwj

添加资源查询

parent 0dbc7b0b
......@@ -5,6 +5,8 @@ import com.gic.auth.entity.TabSysResource;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabSysResourceMapper {
/**
* 根据主键删除
......@@ -57,4 +59,6 @@ public interface TabSysResourceMapper {
Page<TabSysResource> listResource(ResourceDTO resourceDTO);
TabSysResource getBySelective(@Param("enterpriseId") Integer enterpriseId, @Param("resourceName") String resourceName, @Param("resourceId") Integer resourceId);
List<TabSysResource> listByIds(@Param("ids") List<Integer> ids);
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import com.gic.auth.dto.ResourceDTO;
import com.gic.auth.entity.TabSysResource;
import com.github.pagehelper.Page;
import java.util.List;
/**
*
* @Description:
......@@ -22,4 +24,6 @@ public interface ResourceService {
TabSysResource getResource(Integer resourceId);
boolean isRepeatByResourceName(Integer enterpriseId, String resourceName, Integer resourceId);
List<TabSysResource> listByIds(List<Integer> ids);
}
......@@ -8,10 +8,13 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
*
......@@ -63,4 +66,13 @@ public class ResourceServiceImpl implements ResourceService {
TabSysResource resource = tabSysResourceMapper.getBySelective(enterpriseId, resourceName, resourceId);
return resource != null;
}
@Override
public List<TabSysResource> listByIds(List<Integer> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
return tabSysResourceMapper.listByIds(ids);
} else {
return Collections.emptyList();
}
}
}
......@@ -199,5 +199,15 @@
</if>
limit 1
</select>
<select id="listByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_resource
<if test="null != ids">
and resource_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</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