提交 f96db5c3 作者: zhenjie

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/pms into develop

......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 98073d9d0ef617aec952c289956a1f702a2a5648
newTag: a932839ebf99deba86f3a426481ced062cf0bec6
......@@ -30,49 +30,49 @@ public class IndustryTypeController {
@ApiOperation(value = "新增行业")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("insert")
public ResultBody insert(@RequestBody IndustryTypeVO industryTypeVO){
public ResultBody insert(@RequestBody IndustryTypeVO industryTypeVO) {
return industryTypeService.insert(industryTypeVO);
}
@ApiOperation(value = "修改行业")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("update")
public ResultBody update(@RequestBody IndustryTypeVO industryTypeVO){
public ResultBody update(@RequestBody IndustryTypeVO industryTypeVO) {
return industryTypeService.update(industryTypeVO);
}
@ApiOperation(value = "删除行业")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("remove")
public ResultBody remove(@RequestParam Integer id){
public ResultBody remove(@RequestParam Integer id) {
return industryTypeService.remove(id);
}
@ApiOperation(value = "一级行业列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("listPages")
public ResultBody<IndustryTypeDTO> listPages(@Validated(value = {Page.class}) @RequestBody IndustryTypeQO industryTypeQO){
public ResultBody<IndustryTypeDTO> listPages(@Validated(value = {Page.class}) @RequestBody IndustryTypeQO industryTypeQO) {
return industryTypeService.listPages(industryTypeQO);
}
@ApiOperation(value = "根据一级行业id查询二级服务列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustryTypeDTO.class)})
@GetMapping("listInspectionsByIndustryTypeId")
public ResultBody<IndustryTypeDTO> listInspectionsByIndustryTypeId(@RequestParam Integer id){
public ResultBody<IndustryTypeDTO> listInspectionsByIndustryTypeId(@RequestParam Integer id) {
return industryTypeService.listInspectionsByIndustryTypeId(id);
}
@ApiOperation(value = "一级行业详情-全部")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = IndustryTypeDTO.class)})
@GetMapping("getIndustryTypeById")
public ResultBody<IndustryTypeDTO> getIndustryTypeById(@RequestParam Integer id){
public IndustryTypeDTO getIndustryTypeById(@RequestParam Integer id) {
return industryTypeService.getIndustryTypeById(id);
}
@ApiOperation(value = "一级行业列表-全部")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = List.class)})
@PostMapping("listIndustry")
public List<IndustryTypeDTO> listIndustry(@Validated(value = {Page.class}) @RequestBody IndustryTypeQO industryTypeQO){
return industryTypeService.listIndustry(industryTypeQO);
@GetMapping("listIndustry")
public List<IndustryTypeDTO> listIndustry() {
return industryTypeService.listIndustry();
}
}
......@@ -25,7 +25,7 @@ public interface IndustryTypeDao {
List<IndustryTypeDO> listPages(IndustryTypeQO industryTypeQO);
List<IndustryTypeDO> listIndustry(IndustryTypeQO industryTypeQO);
List<IndustryTypeDO> listIndustry();
List<InspectionDO> listInspectionsByIndustryTypeIdId(Integer industryTypeId);
......
......@@ -22,7 +22,7 @@ public interface IndustryTypeService {
ResultBody<IndustryTypeDTO> listInspectionsByIndustryTypeId(Integer id);
ResultBody<IndustryTypeDTO> getIndustryTypeById(Integer id);
IndustryTypeDTO getIndustryTypeById(Integer id);
List<IndustryTypeDTO> listIndustry(IndustryTypeQO industryTypeQO);
List<IndustryTypeDTO> listIndustry();
}
......@@ -84,17 +84,14 @@ public class IndustryTypeServiceImpl implements IndustryTypeService {
}
@Override
public ResultBody<IndustryTypeDTO> getIndustryTypeById(Integer id) {
public IndustryTypeDTO getIndustryTypeById(Integer id) {
IndustryTypeDO industryTypeDO = industryTypeDao.getIndustryTypeById(id);
if (industryTypeDO == null) {
return ResultBody.success();
}
return ResultBody.success(industryTypeDO.buildIndustryTypeDTO());
return industryTypeDO.buildIndustryTypeDTO();
}
@Override
public List<IndustryTypeDTO> listIndustry(IndustryTypeQO industryTypeQO) {
List<IndustryTypeDO> industryTypeDOS = industryTypeDao.listIndustry(industryTypeQO);
public List<IndustryTypeDTO> listIndustry() {
List<IndustryTypeDO> industryTypeDOS = industryTypeDao.listIndustry();
if (CollectionUtils.isNotEmpty(industryTypeDOS)) {
List<IndustryTypeDTO> industryTypeDTOS = industryTypeDOS.stream().map(IndustryTypeDO::buildIndustryTypeDTO).collect(Collectors.toList());
return industryTypeDTOS;
......
......@@ -18,38 +18,51 @@
</resultMap>
<select id="listInspectionsByIndustryTypeIdId" resultType="com.mmc.pms.entity.inspection.InspectionDO">
select ins.id , ins.inspection_no, ins.inspection_name, ins.industry_type_id, ins.inspection_img,
ins.inspection_description, ins.sale_state as ins_sale_state, ins.case_img, ins.case_video, ins.create_time
from inspection ins
where ins.is_deleted = 0 and ins.industry_type_id = #{industryTypeId} order by ins.id desc
select ins.id,
ins.inspection_no,
ins.inspection_name,
ins.industry_type_id,
ins.inspection_img,
ins.inspection_description,
ins.sale_state as ins_sale_state,
ins.case_img,
ins.case_video,
ins.create_time
from inspection ins
where ins.is_deleted = 0
and ins.industry_type_id = #{industryTypeId}
order by ins.id desc
</select>
<insert id="insert" parameterType="com.mmc.pms.entity.inspection.IndustryTypeDO" keyProperty="id" useGeneratedKeys="true">
<insert id="insert" parameterType="com.mmc.pms.entity.inspection.IndustryTypeDO" keyProperty="id"
useGeneratedKeys="true">
insert into industry_type(type_name, type_img, description, sale_state, create_time)
values(#{typeName}, #{typeImg}, #{description}, #{saleState}, NOW())
values (#{typeName}, #{typeImg}, #{description}, #{saleState}, NOW())
</insert>
<update id="update" parameterType="com.mmc.pms.entity.inspection.IndustryTypeDO" >
<update id="update" parameterType="com.mmc.pms.entity.inspection.IndustryTypeDO">
update industry_type
<set>
<if test="typeName != null">
<set>
<if test="typeName != null">
type_name = #{typeName},
</if>
<if test="typeImg != null">
type_img = #{typeImg},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="saleState != null">
sale_state = #{saleState}
</if>
</set>
where id = #{id}
</if>
<if test="typeImg != null">
type_img = #{typeImg},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="saleState != null">
sale_state = #{saleState}
</if>
</set>
where id = #{id}
</update>
<update id="remove">
update industry_type set is_deleted = 1 where id = #{id}
update industry_type
set is_deleted = 1
where id = #{id}
</update>
<select id="countSameName" resultType="java.lang.Integer">
......@@ -65,7 +78,7 @@
<select id="countListPages" resultType="java.lang.Integer"
parameterType="com.mmc.pms.model.qo.IndustryTypeQO">
select count(*) from industry_type it
where it.is_deleted = 0
where it.is_deleted = 0
<if test="id != null">
and it.id = #{id}
</if>
......@@ -77,8 +90,8 @@
<select id="listPages" resultMap="industryTypeResMap"
parameterType="com.mmc.pms.model.qo.IndustryTypeQO">
select it.id, it.type_name, it.type_img, it.description, it.sale_state, it.is_deleted, it.create_time
from industry_type it
where it.is_deleted = 0
from industry_type it
where it.is_deleted = 0
<if test="id != null">
and it.id = #{id}
</if>
......@@ -92,19 +105,11 @@
<select id="listIndustry" resultType="com.mmc.pms.entity.inspection.IndustryTypeDO">
select it.id, it.type_name, it.type_img, it.description, it.sale_state, it.is_deleted, it.create_time
from industry_type it
where 1 = 1
<if test="id != null">
and it.id = #{id}
</if>
<if test="typeName != null">
and it.type_name like concat('%',#{typeName},'%')
</if>
order by it.id DESC
</select>
<select id="getIndustryTypeById" resultType="com.mmc.pms.entity.inspection.IndustryTypeDO">
select it.id, it.type_name, it.type_img, it.description, it.sale_state, it.is_deleted, it.create_time
from industry_type it
where it.id = #{id}
from industry_type it
where it.id = #{id}
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -34,4 +34,5 @@ data-filter:
- /pms/company-inspection/listAPPCompanyInspectionPage
- /pms/company-inspection/getCompanyInspectionById
- /pms/company-inspection/listInspectionPriceUnit
- /pms/lease/goods/feignLeaseGoodsInfoByAddressId
\ No newline at end of file
- /pms/lease/goods/feignLeaseGoodsInfoByAddressId
- /pms/industry/listIndustry
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论