提交 f8356313 authored 作者: malei's avatar malei

feat(fg-resource): 资源服务

1. 附属资源名称不显示 References: N/A
上级 6d5df332
package com.zrqx.fg.resource.mapper.goods;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.resource.bg.goods.ResourceBindingQuery;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.goods.ResourceBinding;
import com.zrqx.core.vo.resource.bg.goods.ResourceBindingVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ResourceBindingMapper extends BaseMapper<ResourceBinding> {
......@@ -29,6 +28,22 @@ public interface ResourceBindingMapper extends BaseMapper<ResourceBinding> {
+ " </script> ")
List<ResourceBindingVo> pageBinding(@Param("query") ResourceBindingQuery query);
@Select(" <script> "
+ " SELECT a.id, b.name, a.otherType type, a.sort, a.createTime, a.otherId FROM "
+ " res_resource_binding a LEFT JOIN res_physical_resource b ON a.otherId = b.id "
+ " WHERE 1 = 1 "
// 主资源id
+ " <if test = '" + NOTBLANK + "(query.mainId)'> "
+ " and a.mainId = #{query.mainId} "
+ " </if> "
// 附属资源类型
+ " <if test = '" + NOTBLANK + "(query.otherType)'> "
+ " and a.otherType = #{query.otherType} "
+ " </if> "
+ " </script> ")
List<ResourceBindingVo> getBindingResource(@Param("query") ResourceBindingQuery query);
/**
* 根据主资源id和附属资源类型获取该附属资源类型最大排序号
* @param mainId
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论