提交 cf50eb08 作者: 张小凤

Industry(update)

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