Commit abe470e2 authored by tianyiming's avatar tianyiming

根据Record获取类别和品种

parent b24f05b5
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.JgAllDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -35,4 +34,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Param("equState")String equState);
Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record);
}
......@@ -24,4 +24,6 @@ public interface IEquipmentCategoryService {
List<LinkedHashMap> creatTree();
List<LinkedHashMap> getRegion(String level, String parentId);
Map<String,Object> getCategoryAndDefineByRecord(String rowId);
}
......@@ -77,7 +77,7 @@
cb_data_dictionary
WHERE
type= #{division}
AND extend = ${county}
AND extend = #{county}
</select>
......@@ -121,4 +121,14 @@
</select>
<select id="getCategoryAndDefineByRecord" resultType="java.util.Map">
SELECT
"EQU_CATEGORY",
"EQU_DEFINE"
FROM
idx_biz_jg_register_info
WHERE
"RECORD" = #{record}
</select>
</mapper>
......@@ -245,4 +245,17 @@ public class EquipmentCategoryController extends BaseController {
@RequestParam(value = "parentId", required = false) String parentId) {
return ResponseHelper.buildResponse(equipmentCategoryService.getRegion(level,parentId));
}
/**
* 根据Record获取类别和品种
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCategoryAndDefineByRecord")
@ApiOperation(httpMethod = "GET", value = "根据Record获取类别和品种", notes = "根据Record获取类别和品种")
public ResponseModel<Object> getCategoryAndDefineById(@RequestParam(value = "rowId", required = false) String rowId) {
return ResponseHelper.buildResponse(equipmentCategoryService.getCategoryAndDefineByRecord(rowId));
}
}
......@@ -193,6 +193,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return list;
}
@Override
public Map<String, Object> getCategoryAndDefineByRecord(String record) {
if(ObjectUtils.isEmpty(record)){
return null;
}
return equipmentCategoryMapper.getCategoryAndDefineByRecord(record);
}
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result, String type) {
Iterator it = result.iterator();
if (ObjectUtils.isEmpty(type)) {
......@@ -235,7 +243,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
StringBuilder supervisorCode = new StringBuilder();
supervisorCode.append(division).append(equipCategory);
supervisorCode.append(division).append(equipCategory).append("-");
//获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//查询对应record对应数据
......
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