Commit beb55d1a authored by 郭凡凡's avatar 郭凡凡

修改bug

parent a0fae7fb
......@@ -43,20 +43,7 @@ public class ApiBasicManagementController {
@Autowired
private ApiBasicManagementService apiBasicManagementService;
@ApiOperation("条件查询")
@GetMapping("/queryOcpApiBaseDto")
public ResponseVO<List<OcpApiBaseVo>> queryOcpApiBaseDto(@RequestParam(required = false) String apiCode,
@RequestParam(required = false) String keyword,
@RequestParam(required = false) String apiUnits,
@RequestParam(required = false) Timestamp startTime,
@RequestParam(required = false) Timestamp endTime,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) Integer pageNum
) {
List<OcpApiBaseVo> list = apiBasicManagementService.queryOcpApiBaseDto(apiCode, keyword, apiUnits, startTime, endTime, pageSize
, pageNum);
return ResponseVO.ok(list);
}
@ApiOperation("导入功能")
@PostMapping("/import")
......
......@@ -16,7 +16,7 @@ import java.util.List;
public interface ApiBasicManagementMapper extends BaseMapper<OcpApiBase> {
List<OcpApiBaseVo> selectApiExport(List<String> list);
List<OcpApiBaseVo> queryOcpApiBaseDto(@Param("keyword") String keyword,@Param("apiUnit") String apiUnit, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("apiCode") String apiCode, @Param("pageSize") int pageSize, @Param("pageNum") int pageNum);
List<OcpApiBase> selectByCondition(@Param("apiCode") String apiCode, @Param("apiName") String apiName, @Param("apiCenterCode") String apiCenterCode);
}
......@@ -37,16 +37,7 @@ public interface ApiBasicManagementService extends IService<OcpApiBase> {
*/
void apiLogin(String apiCodes);
/**
* 条件查询
* @param apiCode
* @param keyword
* @param startTime
* @param endTime
* @return
*/
// OcpApiBaseDto queryOcpApiBaseDto(ApiBaseDto apiBaseDto);
List<OcpApiBaseVo> queryOcpApiBaseDto(String apiCode, String keyword, String apiUnits, Timestamp startTime, Timestamp endTime, int pageSize, int pageNum);
/**
* 导入的添加到数据库
* @param personList
......
......@@ -97,21 +97,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
}
}
/**
* 条件查询
*
* @param apiCode
* @param keyword
* @param apiUnit
* @param startTime
* @param endTime
* @return
*/
@Override
public List<OcpApiBaseVo> queryOcpApiBaseDto(String apiCode, String keyword, String apiUnit, Timestamp startTime, Timestamp endTime, int pageSize, int pageNum) {
pageSize = (pageSize - 1) * pageNum;
return apiBasicManagementMapper.queryOcpApiBaseDto(keyword, apiUnit, startTime, endTime, apiCode, pageSize, pageNum);
}
/**
* 导入添加到数据库
......
......@@ -27,47 +27,47 @@
</select>
<select id="queryOcpApiBaseDto" resultMap="oabMap">
select
oab.obj_id,
oab.api_code,oae.api_code,oab.api_name,oae.cluster_name,
oae.space_name,oab.api_url,oae.api_state ,oab.api_unit ,oab.api_ctime from ocp_api_base oab
join ocp_api_extent oae ON oae.api_code = oab.api_code
<where>
<if test="apiCode!=null and apiCode!=''">
and oab.api_code=#{apiCode}
</if>
<if test="apiCode!=null and apiCode!=''">
and oae.api_code=#{apiCode}
</if>
<if test="startTime !=null ">
<![CDATA[
and oab.api_ctime >= #{startTime}
]]>
</if>
<if test="endTime !=null ">
<![CDATA[
and oab.api_ctime <= #{endTime}
]]>
</if>
<if test="keyword !=null and keyword != '' ">
and oab.api_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and oab.api_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="apiUnit !=null and apiUnit!=''">
and oab.api_unit =#{apiUnit}
</if>
<!-- <if test="list!=null">-->
<!-- and oab.api_unit in-->
<!-- <foreach collection="list" index="index" item="apiUnit" open="(" separator="," close=")">-->
<!-- #{apiUnit}-->
<!-- </foreach>-->
<!-- </if>-->
</where>
limit #{pageNum} offset #{pageSize}
</select>
<!-- <select id="queryOcpApiBaseDto" resultMap="oabMap">-->
<!-- select-->
<!-- oab.obj_id,-->
<!-- oab.api_code,oae.api_code,oab.api_name,oae.cluster_name,-->
<!-- oae.space_name,oab.api_url,oae.api_state ,oab.api_unit ,oab.api_ctime from ocp_api_base oab-->
<!-- join ocp_api_extent oae ON oae.api_code = oab.api_code-->
<!-- <where>-->
<!-- <if test="apiCode!=null and apiCode!=''">-->
<!-- and oab.api_code=#{apiCode}-->
<!-- </if>-->
<!-- <if test="apiCode!=null and apiCode!=''">-->
<!-- and oae.api_code=#{apiCode}-->
<!-- </if>-->
<!-- <if test="startTime !=null ">-->
<!-- <![CDATA[-->
<!-- and oab.api_ctime >= #{startTime}-->
<!-- ]]>-->
<!-- </if>-->
<!-- <if test="endTime !=null ">-->
<!-- <![CDATA[-->
<!-- and oab.api_ctime <= #{endTime}-->
<!-- ]]>-->
<!-- </if>-->
<!-- <if test="keyword !=null and keyword != '' ">-->
<!-- and oab.api_code like CONCAT('%', #{keyword}::text,'%')-->
<!-- </if>-->
<!-- <if test="keyword !=null and keyword != '' ">-->
<!-- and oab.api_name like CONCAT('%', #{keyword}::text,'%')-->
<!-- </if>-->
<!-- <if test="apiUnit !=null and apiUnit!=''">-->
<!-- and oab.api_unit =#{apiUnit}-->
<!-- </if>-->
<!-- &lt;!&ndash; <if test="list!=null">&ndash;&gt;-->
<!-- &lt;!&ndash; and oab.api_unit in&ndash;&gt;-->
<!-- &lt;!&ndash; <foreach collection="list" index="index" item="apiUnit" open="(" separator="," close=")">&ndash;&gt;-->
<!-- &lt;!&ndash; #{apiUnit}&ndash;&gt;-->
<!-- &lt;!&ndash; </foreach>&ndash;&gt;-->
<!-- &lt;!&ndash; </if>&ndash;&gt;-->
<!-- </where>-->
<!-- limit #{pageNum} offset #{pageSize}-->
<!-- </select>-->
<select id="selectByCondition" resultType="com.pms.ocp.model.entity.OcpApiBase">
......
......@@ -54,7 +54,7 @@
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where is_delete = 0
<if test="apiGroupPcode == null">
and api_group_pcode is null
and api_group_pcode is null or api_group_pcode =''
</if>
<if test="apiGroupPcode!=null and apiGroupPcode!=''">
and api_group_pcode = #{apiGroupPcode}
......@@ -75,34 +75,34 @@
oae.space_name,oab.api_url,oae.api_state ,oab.api_unit ,oab.api_ctime from ocp_api_base oab
LEFT JOIN ocp_api_extent oae
on oab.api_code = oae.api_code
<where>
<if test="apiGroupCodeList !=null ">
and oab.api_group_code in
<foreach item="apiGroupCode" collection="apiGroupCodeList" open="(" separator=","
close=")">
#{apiGroupCode}
</foreach>
</if>
<if test="apiUnit !=null and apiUnit!=''">
and oab.api_unit = #{apiUnit}
</if>
<if test="apiPromotion !=null and apiPromotion!=''">
and oab.api_promotion = #{apiPromotion}
</if>
<if test="startCTime !=null ">
<![CDATA[
<where>
<if test="apiGroupCodeList !=null ">
and oab.api_group_code in
<foreach item="apiGroupCode" collection="apiGroupCodeList" open="(" separator=","
close=")">
#{apiGroupCode}
</foreach>
</if>
<if test="apiUnit !=null and apiUnit!=''">
and oab.api_unit = #{apiUnit}
</if>
<if test="apiPromotion !=null and apiPromotion!=''">
and oab.api_promotion = #{apiPromotion}
</if>
<if test="startCTime !=null ">
<![CDATA[
and oab.api_ctime >= #{startCTime}
]]>
</if>
<if test="endCTime !=null ">
<![CDATA[
</if>
<if test="endCTime !=null ">
<![CDATA[
and oab.api_ctime <= #{endCTime}
]]>
</if>
<if test="keyword !=null and keyword != '' ">
and oab.api_name like CONCAT('%', #{keyword}::text,'%')
</if>
</where>
</if>
<if test="keyword !=null and keyword != '' ">
and oab.api_name like CONCAT('%', #{keyword}::text,'%')
</if>
</where>
</select>
......
......@@ -21,7 +21,7 @@
tenant_group_code,tenant_group_name,tenant_group_pcode ,tenant_group_level from ocp_tenant_group
where is_delete = 0
<if test="tenantGroupCode == null">
and tenant_group_pcode is null
and tenant_group_pcode = '' or tenant_group_pcode is null
</if>
<if test="tenantGroupCompanyCode !=null and tenantGroupCompanyCode !=''">
and tenant_group_company_code=#{tenantGroupCompanyCode}
......
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