pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaBlockMapper.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoBa.BaBlock; import com.dy.pipIrrGlobal.pojoBa.BaClientType; import com.dy.pipIrrGlobal.pojoBa.BaPrivilege; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -21,6 +22,13 @@ /** * 得到全部实体 * @return 全部实体 */ List<BaBlock> selectAll() ; /** * 查询总数 * @param params 查询条件 * @return 总数 pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
@@ -16,6 +16,10 @@ <!--@mbg.generated--> id, `name`, `header`, phone, area, color,deleted </sql> <sql id="part_Column_List"> <!--@mbg.generated--> id, `name` </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <!--@mbg.generated--> select @@ -23,7 +27,14 @@ from ba_block where id = #{id,jdbcType=BIGINT} </select> <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> <select id="selectAll" resultMap="BaseResultMap"> select <include refid="part_Column_List" /> from ba_block </select> <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> select count(*) from ba_block pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java
@@ -6,6 +6,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.common.webUtil.ResultCodeMsg; import com.dy.pipIrrGlobal.pojoBa.BaBlock; import com.dy.pipIrrGlobal.pojoBa.BaBlock; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -41,6 +42,31 @@ * 客户端请求得到所有片区数据 * @return 所有片区数据 */ @Operation(summary = "获得全部片区", description = "返回全部片区数据") @ApiResponses(value = { @ApiResponse( responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回全部片区数据(BaseResponse.content:QueryResultVo[{}])", content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = BaBlock.class))} ) }) @GetMapping(path = "all") @SsoAop("-1") public BaseResponse<QueryResultVo<List<BaBlock>>> all(){ try { QueryResultVo<List<BaBlock>> res = this.sv.selectAll() ; return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("查询片区异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } /** * 客户端请求得到所有片区数据 * @return 所有片区数据 */ @Operation(summary = "获得一页片区", description = "返回一页片区数据") @ApiResponses(value = { @ApiResponse( pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java
@@ -3,6 +3,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoBa.BaBlockMapper; import com.dy.pipIrrGlobal.pojoBa.BaBlock; import com.dy.pipIrrGlobal.pojoBa.BaClientType; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +33,16 @@ return this.dao.selectByPrimaryKey(id) ; } /** * 得到所有片区 * @return 所有片区集合 */ public QueryResultVo<List<BaBlock>> selectAll(){ QueryResultVo<List<BaBlock>> rsVo = new QueryResultVo<>() ; rsVo.obj = this.dao.selectAll() ; return rsVo ; } /** * 得到一个片区 * @param vo 查询条件值对象