Commit 1cd331d9 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev-chw' into dev-chw

parents 40689640 b558724e
...@@ -11,4 +11,11 @@ public class VehicleApplyVo extends VehicleApply { ...@@ -11,4 +11,11 @@ public class VehicleApplyVo extends VehicleApply {
@ApiModelProperty("店铺名称") @ApiModelProperty("店铺名称")
String companyName; String companyName;
@ApiModelProperty("品牌名称")
String brandName;
@ApiModelProperty("型号名称")
String categoryName;
} }
...@@ -137,6 +137,19 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{ ...@@ -137,6 +137,19 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{
public List<VehicleApplyVo> getListByApp(VehicleApplyFindDTO vehicleApplyFindDTO){
return mapper.selectListByApp(vehicleApplyFindDTO);
}
public ObjectRestResponse selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO){
PageHelper.startPage(vehicleApplyFindDTO.getPage(), vehicleApplyFindDTO.getLimit());
PageInfo<VehicleApplyVo> pageInfo = new PageInfo<>(getListByApp(vehicleApplyFindDTO));
return ObjectRestResponse.succ(PageDataVO.pageInfo(pageInfo));
}
......
...@@ -17,4 +17,6 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList ...@@ -17,4 +17,6 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList
@Select("SELECT * FROM vehicle_apply WHERE vehicle_id=#{vehicleId} and form_type=2 ORDER BY upd_time DESC LIMIT 1") @Select("SELECT * FROM vehicle_apply WHERE vehicle_id=#{vehicleId} and form_type=2 ORDER BY upd_time DESC LIMIT 1")
VehicleApply getOneByOrderUpdTime(@Param("vehicleId") String vehicleId); VehicleApply getOneByOrderUpdTime(@Param("vehicleId") String vehicleId);
}
\ No newline at end of file List<VehicleApplyVo> selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO);
}
\ No newline at end of file
...@@ -3,13 +3,11 @@ package com.xxfc.platform.vehicle.rest; ...@@ -3,13 +3,11 @@ package com.xxfc.platform.vehicle.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.VehicleApplyBiz; import com.xxfc.platform.vehicle.biz.VehicleApplyBiz;
import com.xxfc.platform.vehicle.entity.Vehicle; import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.pojo.dto.VehicleApplyFindDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -40,6 +38,22 @@ public class AppVehicleApplyController extends BaseController<VehicleApplyBiz> { ...@@ -40,6 +38,22 @@ public class AppVehicleApplyController extends BaseController<VehicleApplyBiz> {
@GetMapping("apply/selectList")
@ApiModelProperty("商品审核列表")
public ObjectRestResponse selectList(VehicleApplyFindDTO vehicleApplyFindDTO) {
List<Integer> companyIds = getCompanyIds();
if (companyIds == null && companyIds.size() == 0){
return ObjectRestResponse.succ();
}
vehicleApplyFindDTO.setDataCompanyIds(companyIds);
return baseBiz.selectListByApp(vehicleApplyFindDTO);
}
......
...@@ -40,4 +40,37 @@ ...@@ -40,4 +40,37 @@
</where> </where>
order by a.upd_time DESC order by a.upd_time DESC
</select> </select>
<select id="selectListByApp" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleApplyVo" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehicleApplyFindDTO">
SELECT
v.*,
b.cn_name as brandName,
c.`name` categoryName
FROM
(SELECT v.* FROM
(SELECT * FROM vehicle_apply
WHERE (vehicle_id is NOT NULL and vehicle_id != '' ) and apply_status != 1
ORDER BY id desc) v
GROUP BY v.vehicle_id
UNION ALL
SELECT * FROM vehicle_apply WHERE apply_status != 1 and (vehicle_id is NULL OR vehicle_id = '' )) v
LEFT JOIN vehicle_brand b ON v.brand_id=b.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN branch_company i on v.subordinate_branch=i.id
<where>
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and i.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and i.company_id in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by v.crt_time DESC
</select>
</mapper> </mapper>
\ No newline at end of file
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