车辆类型筛选

This commit is contained in:
guoshengxiong 2024-05-15 20:51:25 +08:00
parent 3effa96125
commit 9470a7913f
2 changed files with 21 additions and 17 deletions

View File

@ -66,6 +66,7 @@ public class CarInfoController {
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "carModuleType", value = "车辆类型1、固定车2、预约车辆临时、3外来车辆", paramType = "body", required = false, dataType = "Integer"),
}) })
@PostMapping(value = "/selectCarList") @PostMapping(value = "/selectCarList")
public Result<IPage<EntityMap>> selectCarList(@RequestBody Map<String,Object> map) { public Result<IPage<EntityMap>> selectCarList(@RequestBody Map<String,Object> map) {

View File

@ -3,29 +3,32 @@
<mapper namespace="com.zhgd.xmgl.modules.car.mapper.CarInfoMapper"> <mapper namespace="com.zhgd.xmgl.modules.car.mapper.CarInfoMapper">
<select id="selectCarList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap"> <select id="selectCarList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT if(a.car_module_type=1 or a.car_module_type=2,wi.id_card,a.outside_driver_id_card) as SELECT if(t.car_module_type=1 or t.car_module_type=2,wi.id_card,t.outside_driver_id_card) as
outside_driver_id_card, outside_driver_id_card,
a.*,b.car_type_name,ei.enterprise_name t.*,b.car_type_name,ei.enterprise_name
FROM car_info a LEFT JOIN car_type b ON (a.car_type=b.id and a.project_sn=b.project_sn) FROM car_info t LEFT JOIN car_type b ON (t.car_type=b.id and t.project_sn=b.project_sn)
left join enterprise_info ei on ei.id=a.enterprise_id left join enterprise_info ei on ei.id=t.enterprise_id
left join worker_info wi on a.driver_worker_id = wi.id left join worker_info wi on t.driver_worker_id = wi.id
WHERE a.project_sn=#{param.projectSn} WHERE t.project_sn=#{param.projectSn}
<if test="param.carNumber != null and param.carNumber != ''"> <if test="param.carNumber != null and param.carNumber != ''">
and a.car_number like CONCAT(CONCAT('%',#{param.carNumber}),'%') and t.car_number like CONCAT(CONCAT('%',#{param.carNumber}),'%')
</if> </if>
<if test="param.isBlack != null"> <if test="param.isBlack != null">
and a.is_black=#{param.isBlack} and t.is_black=#{param.isBlack}
</if>
<if test="param.carModuleType != null and param.carModuleType != ''">
and t.car_module_type = #{param.carModuleType}
</if> </if>
<if test="param.enterpriseIds != null and param.enterpriseIds.size() != 0"> <if test="param.enterpriseIds != null and param.enterpriseIds.size() != 0">
and a.enterprise_id in and t.enterprise_id in
<foreach collection="param.enterpriseIds" index="index" item="item" open="(" separator="," close=")"> <foreach collection="param.enterpriseIds" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.sendSuccessStatus != null"> <if test="param.sendSuccessStatus != null">
and a.send_success_status = #{param.sendSuccessStatus} and t.send_success_status = #{param.sendSuccessStatus}
</if> </if>
order by a.id desc order by t.id desc
</select> </select>
<select id="selectCarTypeCount" resultType="java.util.Map"> <select id="selectCarTypeCount" resultType="java.util.Map">
SELECT b.car_type_name carTypeName,COUNT(1) carTypeNum, SELECT b.car_type_name carTypeName,COUNT(1) carTypeNum,