From a26d2f7359a163c37edef8ea545f77a773bedc84 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期二, 25 十月 2022 14:04:25 +0800 Subject: [PATCH] 车辆管理bug --- ycl-platform/src/main/resources/mapper/carManage/CarEnforcecarMapper.xml | 36 ++++++++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ycl-platform/src/main/resources/mapper/carManage/CarEnforcecarMapper.xml b/ycl-platform/src/main/resources/mapper/carManage/CarEnforcecarMapper.xml index c61efce..3917dd9 100644 --- a/ycl-platform/src/main/resources/mapper/carManage/CarEnforcecarMapper.xml +++ b/ycl-platform/src/main/resources/mapper/carManage/CarEnforcecarMapper.xml @@ -4,18 +4,38 @@ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 --> <resultMap id="BaseResultMap" type="com.ycl.entity.carManage.CarEnforcecar"> - <id column="id" property="id" /> - <result column="car_number" property="carNumber" /> - <result column="owner_name" property="ownerName" /> - <result column="vehicle_user" property="vehicleUser" /> - <result column="contact" property="contact" /> - <result column="trajectory" property="trajectory" /> - <result column="group" property="group" /> + <id column="id" property="id"/> + <result column="car_number" property="carNumber"/> + <result column="owner_name" property="ownerName"/> + <result column="vehicle_user" property="vehicleUser"/> + <result column="contact" property="contact"/> + <result column="trajectory" property="trajectory"/> + <result column="depart_id" property="departId"/> + </resultMap> + + <resultMap id="VoMap" type="com.ycl.dto.carManage.CarEnforcecarVo"> + <result column="depart_name" property="departName" jdbcType="VARCHAR"/> + <result column="p_depart_name" property="pDepartName" jdbcType="VARCHAR"/> </resultMap> <!-- 閫氱敤鏌ヨ缁撴灉鍒� --> <sql id="Base_Column_List"> - id, car_number, owner_name, vehicle_user, contact, trajectory, group + id + , car_number, owner_name, vehicle_user, contact, trajectory, group </sql> + <select id="searchEnforceCar" resultType="com.ycl.dto.carManage.CarEnforcecarVo"> + SELECT ce.*,IF(p.depart_name is null ,'',d.depart_name) depart_name,IFNULL(p.depart_name,d.depart_name) + p_depart_name + FROM ums_car_enforcecar ce + LEFT JOIN ums_depart d on ce.depart_id = d.id + LEFT JOIN ums_depart p on d.parent_id = p.id + <where> + <if test="carNum!=null"> + ce.car_number like CONCAT('%',#{carNum},'%') + </if> + </where> + order by ce.id desc + LIMIT #{offset}, #{size} + </select> </mapper> -- Gitblit v1.8.0