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

修改bug

parent a0fae7fb
...@@ -43,20 +43,7 @@ public class ApiBasicManagementController { ...@@ -43,20 +43,7 @@ public class ApiBasicManagementController {
@Autowired @Autowired
private ApiBasicManagementService apiBasicManagementService; 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("导入功能") @ApiOperation("导入功能")
@PostMapping("/import") @PostMapping("/import")
......
...@@ -16,7 +16,7 @@ import java.util.List; ...@@ -16,7 +16,7 @@ import java.util.List;
public interface ApiBasicManagementMapper extends BaseMapper<OcpApiBase> { public interface ApiBasicManagementMapper extends BaseMapper<OcpApiBase> {
List<OcpApiBaseVo> selectApiExport(List<String> list); 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); 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> { ...@@ -37,16 +37,7 @@ public interface ApiBasicManagementService extends IService<OcpApiBase> {
*/ */
void apiLogin(String apiCodes); 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 * @param personList
......
...@@ -97,21 +97,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen ...@@ -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 @@ ...@@ -27,47 +27,47 @@
</select> </select>
<select id="queryOcpApiBaseDto" resultMap="oabMap"> <!-- <select id="queryOcpApiBaseDto" resultMap="oabMap">-->
select <!-- select-->
oab.obj_id, <!-- oab.obj_id,-->
oab.api_code,oae.api_code,oab.api_name,oae.cluster_name, <!-- 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 <!-- 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 <!-- join ocp_api_extent oae ON oae.api_code = oab.api_code-->
<where> <!-- <where>-->
<if test="apiCode!=null and apiCode!=''"> <!-- <if test="apiCode!=null and apiCode!=''">-->
and oab.api_code=#{apiCode} <!-- and oab.api_code=#{apiCode}-->
</if> <!-- </if>-->
<if test="apiCode!=null and apiCode!=''"> <!-- <if test="apiCode!=null and apiCode!=''">-->
and oae.api_code=#{apiCode} <!-- and oae.api_code=#{apiCode}-->
</if> <!-- </if>-->
<if test="startTime !=null "> <!-- <if test="startTime !=null ">-->
<![CDATA[ <!-- <![CDATA[-->
and oab.api_ctime >= #{startTime} <!-- and oab.api_ctime >= #{startTime}-->
]]> <!-- ]]>-->
</if> <!-- </if>-->
<if test="endTime !=null "> <!-- <if test="endTime !=null ">-->
<![CDATA[ <!-- <![CDATA[-->
and oab.api_ctime <= #{endTime} <!-- and oab.api_ctime <= #{endTime}-->
]]> <!-- ]]>-->
</if> <!-- </if>-->
<if test="keyword !=null and keyword != '' "> <!-- <if test="keyword !=null and keyword != '' ">-->
and oab.api_code like CONCAT('%', #{keyword}::text,'%') <!-- and oab.api_code like CONCAT('%', #{keyword}::text,'%')-->
</if> <!-- </if>-->
<if test="keyword !=null and keyword != '' "> <!-- <if test="keyword !=null and keyword != '' ">-->
and oab.api_name like CONCAT('%', #{keyword}::text,'%') <!-- and oab.api_name like CONCAT('%', #{keyword}::text,'%')-->
</if> <!-- </if>-->
<if test="apiUnit !=null and apiUnit!=''"> <!-- <if test="apiUnit !=null and apiUnit!=''">-->
and oab.api_unit =#{apiUnit} <!-- and oab.api_unit =#{apiUnit}-->
</if> <!-- </if>-->
<!-- <if test="list!=null">--> <!-- &lt;!&ndash; <if test="list!=null">&ndash;&gt;-->
<!-- and oab.api_unit in--> <!-- &lt;!&ndash; and oab.api_unit in&ndash;&gt;-->
<!-- <foreach collection="list" index="index" item="apiUnit" open="(" separator="," close=")">--> <!-- &lt;!&ndash; <foreach collection="list" index="index" item="apiUnit" open="(" separator="," close=")">&ndash;&gt;-->
<!-- #{apiUnit}--> <!-- &lt;!&ndash; #{apiUnit}&ndash;&gt;-->
<!-- </foreach>--> <!-- &lt;!&ndash; </foreach>&ndash;&gt;-->
<!-- </if>--> <!-- &lt;!&ndash; </if>&ndash;&gt;-->
</where> <!-- </where>-->
limit #{pageNum} offset #{pageSize} <!-- limit #{pageNum} offset #{pageSize}-->
</select> <!-- </select>-->
<select id="selectByCondition" resultType="com.pms.ocp.model.entity.OcpApiBase"> <select id="selectByCondition" resultType="com.pms.ocp.model.entity.OcpApiBase">
......
...@@ -54,7 +54,7 @@ ...@@ -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 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"> <if test="apiGroupPcode == null">
and api_group_pcode is null and api_group_pcode is null or api_group_pcode =''
</if> </if>
<if test="apiGroupPcode!=null and apiGroupPcode!=''"> <if test="apiGroupPcode!=null and apiGroupPcode!=''">
and api_group_pcode = #{apiGroupPcode} and api_group_pcode = #{apiGroupPcode}
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
tenant_group_code,tenant_group_name,tenant_group_pcode ,tenant_group_level from ocp_tenant_group tenant_group_code,tenant_group_name,tenant_group_pcode ,tenant_group_level from ocp_tenant_group
where is_delete = 0 where is_delete = 0
<if test="tenantGroupCode == null"> <if test="tenantGroupCode == null">
and tenant_group_pcode is null and tenant_group_pcode = '' or tenant_group_pcode is null
</if> </if>
<if test="tenantGroupCompanyCode !=null and tenantGroupCompanyCode !=''"> <if test="tenantGroupCompanyCode !=null and tenantGroupCompanyCode !=''">
and tenant_group_company_code=#{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