Commit d56960dd490bfffdbfb23ebf987af9e4a98b0a32
Merge branch 'dev' of http://61.169.120.202:8888/youxiw20000/trash into dev
Showing
5 changed files
with
29 additions
and
22 deletions
trash-unit/src/main/java/com/trash/carInfo/controller/CarInfoController.java
| @@ -41,8 +41,9 @@ public class CarInfoController extends BaseController | @@ -41,8 +41,9 @@ public class CarInfoController extends BaseController | ||
| 41 | public TableDataInfo list(CarInfoVo carInfo) | 41 | public TableDataInfo list(CarInfoVo carInfo) |
| 42 | { | 42 | { |
| 43 | startPage(); | 43 | startPage(); |
| 44 | - carInfo.setIsDel("1"); | 44 | + carInfo.setIsDel(1); |
| 45 | List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo); | 45 | List<CarInfoVo> list = carInfoService.selectCarInfoList(carInfo); |
| 46 | + TableDataInfo data = getDataTable(list); | ||
| 46 | if(CollectionUtils.isNotEmpty(list)){ | 47 | if(CollectionUtils.isNotEmpty(list)){ |
| 47 | list = list.stream().map(car->{ | 48 | list = list.stream().map(car->{ |
| 48 | if(Objects.equals(car.getCarType(),"轻型货车")){ | 49 | if(Objects.equals(car.getCarType(),"轻型货车")){ |
| @@ -59,7 +60,7 @@ public class CarInfoController extends BaseController | @@ -59,7 +60,7 @@ public class CarInfoController extends BaseController | ||
| 59 | }).collect(Collectors.toList()); | 60 | }).collect(Collectors.toList()); |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | - return getDataTable(list); | 63 | + return data; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | /** | 66 | /** |
trash-unit/src/main/java/com/trash/carInfo/domain/CarInfo.java
| @@ -119,6 +119,16 @@ public class CarInfo extends BaseEntity | @@ -119,6 +119,16 @@ public class CarInfo extends BaseEntity | ||
| 119 | @Excel(name = "二维码") | 119 | @Excel(name = "二维码") |
| 120 | private String qrCode; | 120 | private String qrCode; |
| 121 | 121 | ||
| 122 | + private int isDel; | ||
| 123 | + | ||
| 124 | + public int getIsDel() { | ||
| 125 | + return isDel; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public void setIsDel(int isDel) { | ||
| 129 | + this.isDel = isDel; | ||
| 130 | + } | ||
| 131 | + | ||
| 122 | public String getLengthWidthHeight() { | 132 | public String getLengthWidthHeight() { |
| 123 | return lengthWidthHeight; | 133 | return lengthWidthHeight; |
| 124 | } | 134 | } |
trash-unit/src/main/java/com/trash/carInfo/domain/vo/CarInfoVo.java
| @@ -7,7 +7,6 @@ public class CarInfoVo extends CarInfo { | @@ -7,7 +7,6 @@ public class CarInfoVo extends CarInfo { | ||
| 7 | 7 | ||
| 8 | private String driversName; | 8 | private String driversName; |
| 9 | 9 | ||
| 10 | - private String isDel; | ||
| 11 | 10 | ||
| 12 | public String getCompanyName() { | 11 | public String getCompanyName() { |
| 13 | return companyName; | 12 | return companyName; |
| @@ -25,11 +24,4 @@ public class CarInfoVo extends CarInfo { | @@ -25,11 +24,4 @@ public class CarInfoVo extends CarInfo { | ||
| 25 | this.driversName = driversName; | 24 | this.driversName = driversName; |
| 26 | } | 25 | } |
| 27 | 26 | ||
| 28 | - public String getIsDel() { | ||
| 29 | - return isDel; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public void setIsDel(String isDel) { | ||
| 33 | - this.isDel = isDel; | ||
| 34 | - } | ||
| 35 | } | 27 | } |
trash-unit/src/main/java/com/trash/carInfo/service/impl/CarInfoServiceImpl.java
| @@ -82,6 +82,7 @@ public class CarInfoServiceImpl implements ICarInfoService | @@ -82,6 +82,7 @@ public class CarInfoServiceImpl implements ICarInfoService | ||
| 82 | carInfo.setCreateBy(SecurityUtils.getUsername()); | 82 | carInfo.setCreateBy(SecurityUtils.getUsername()); |
| 83 | carInfo.setCreditStatus("正常"); | 83 | carInfo.setCreditStatus("正常"); |
| 84 | carInfo.setStatus(0); | 84 | carInfo.setStatus(0); |
| 85 | + carInfo.setIsDel(1); | ||
| 85 | for (MultipartFile file : roadTransportFiles) { | 86 | for (MultipartFile file : roadTransportFiles) { |
| 86 | carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file)); | 87 | carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file)); |
| 87 | } | 88 | } |
trash-unit/src/main/resources/mapper/unit/CarInfoMapper.xml
| @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 35 | <result property="updateBy" column="update_by" /> | 35 | <result property="updateBy" column="update_by" /> |
| 36 | <result property="creditStatus" column="credit_status" /> | 36 | <result property="creditStatus" column="credit_status" /> |
| 37 | <result property="qrCode" column="qr_code" /> | 37 | <result property="qrCode" column="qr_code" /> |
| 38 | + <result property="isDel" column="is_del" /> | ||
| 38 | </resultMap> | 39 | </resultMap> |
| 39 | 40 | ||
| 40 | <resultMap type="CarInfoVo" id="CarInfoVoResult"> | 41 | <resultMap type="CarInfoVo" id="CarInfoVoResult"> |
| @@ -70,11 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -70,11 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 70 | <result property="qrCode" column="qr_code" /> | 71 | <result property="qrCode" column="qr_code" /> |
| 71 | <result property="companyName" column="companyName" /> | 72 | <result property="companyName" column="companyName" /> |
| 72 | <result property="driversName" column="driversName" /> | 73 | <result property="driversName" column="driversName" /> |
| 73 | - <result property="is_del" column="isDel" /> | ||
| 74 | </resultMap> | 74 | </resultMap> |
| 75 | 75 | ||
| 76 | <sql id="selectCarInfoVo"> | 76 | <sql id="selectCarInfoVo"> |
| 77 | - select id, company_id, car_type, car_code, car_brank, emission_standard, road_transport_date, driving_license_date, enter_date, farme_number, car_identification, container_volume, car_color, car_equipment, remark, road_transport, driving_license, car_front, car_left, car_behind, car_right, drivers, status, create_time, create_by, update_time, update_by, credit_status, qr_code from car_info | 77 | + select id, company_id, car_type, car_code, car_brank, emission_standard, road_transport_date, driving_license_date, enter_date, farme_number, car_identification, container_volume, car_color, car_equipment, remark, road_transport, driving_license, car_front, car_left, car_behind, car_right, drivers, status, create_time, create_by, update_time, update_by, credit_status, qr_code,is_del from car_info |
| 78 | </sql> | 78 | </sql> |
| 79 | 79 | ||
| 80 | <sql id="selectCarInfoForCompanyVo"> | 80 | <sql id="selectCarInfoForCompanyVo"> |
| @@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 120 | 120 | ||
| 121 | <select id="selectCarInfoList" parameterType="CarInfoVo" resultMap="CarInfoVoResult"> | 121 | <select id="selectCarInfoList" parameterType="CarInfoVo" resultMap="CarInfoVoResult"> |
| 122 | <include refid="selectCarInfoForCompanyVo"/> | 122 | <include refid="selectCarInfoForCompanyVo"/> |
| 123 | - <where> | 123 | + <where> |
| 124 | <if test="companyName != null and companyName != ''"> and c.name like concat('%',#{companyName},'%')</if> | 124 | <if test="companyName != null and companyName != ''"> and c.name like concat('%',#{companyName},'%')</if> |
| 125 | <if test="carType != null and carType != ''"> and car_type = #{carType}</if> | 125 | <if test="carType != null and carType != ''"> and car_type = #{carType}</if> |
| 126 | <if test="carCode != null and carCode != ''"> and car_code like concat('%',#{carCode},'%')</if> | 126 | <if test="carCode != null and carCode != ''"> and car_code like concat('%',#{carCode},'%')</if> |
| @@ -143,19 +143,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -143,19 +143,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 143 | <if test="drivers != null and drivers != ''"> and drivers = #{drivers}</if> | 143 | <if test="drivers != null and drivers != ''"> and drivers = #{drivers}</if> |
| 144 | <if test="status != null "> and car.status = #{status}</if> | 144 | <if test="status != null "> and car.status = #{status}</if> |
| 145 | <if test="creditStatus != null and creditStatus != ''"> and car.credit_status = #{creditStatus}</if> | 145 | <if test="creditStatus != null and creditStatus != ''"> and car.credit_status = #{creditStatus}</if> |
| 146 | - <if test="isDel != null and isDel != ''"> and car.is_del = #{isDel}</if> | 146 | + <if test="isDel != null"> and car.is_del = #{isDel}</if> |
| 147 | </where> | 147 | </where> |
| 148 | </select> | 148 | </select> |
| 149 | 149 | ||
| 150 | <select id="selectCarInfoById" parameterType="Long" resultMap="CarInfoResult"> | 150 | <select id="selectCarInfoById" parameterType="Long" resultMap="CarInfoResult"> |
| 151 | <include refid="selectCarInfoVo"/> | 151 | <include refid="selectCarInfoVo"/> |
| 152 | - where id = #{id} | 152 | + where id = #{id} and is_del = 1 |
| 153 | </select> | 153 | </select> |
| 154 | 154 | ||
| 155 | 155 | ||
| 156 | <select id="selectByCompanyId" parameterType="Long" resultMap="CarInfoVoResult"> | 156 | <select id="selectByCompanyId" parameterType="Long" resultMap="CarInfoVoResult"> |
| 157 | <include refid="selectCarInfoForCompanyVo"/> | 157 | <include refid="selectCarInfoForCompanyVo"/> |
| 158 | - where car.company_id=#{companyId} | 158 | + where car.company_id=#{companyId} and is_del = 1 |
| 159 | </select> | 159 | </select> |
| 160 | 160 | ||
| 161 | 161 | ||
| @@ -191,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -191,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 191 | <if test="creditStatus != null">credit_status,</if> | 191 | <if test="creditStatus != null">credit_status,</if> |
| 192 | <if test="qrCode != null">qr_code,</if> | 192 | <if test="qrCode != null">qr_code,</if> |
| 193 | <if test="lengthWidthHeight != null">length_width_height,</if> | 193 | <if test="lengthWidthHeight != null">length_width_height,</if> |
| 194 | + <if test="isDel != null">is_del,</if> | ||
| 194 | </trim> | 195 | </trim> |
| 195 | <trim prefix="values (" suffix=")" suffixOverrides=","> | 196 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 196 | <if test="companyId != null">#{companyId},</if> | 197 | <if test="companyId != null">#{companyId},</if> |
| @@ -222,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -222,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 222 | <if test="creditStatus != null">#{creditStatus},</if> | 223 | <if test="creditStatus != null">#{creditStatus},</if> |
| 223 | <if test="qrCode != null">#{qrCode},</if> | 224 | <if test="qrCode != null">#{qrCode},</if> |
| 224 | <if test="lengthWidthHeight != null">#{lengthWidthHeight},</if> | 225 | <if test="lengthWidthHeight != null">#{lengthWidthHeight},</if> |
| 226 | + <if test="isDel != null">#{isDel},</if> | ||
| 225 | </trim> | 227 | </trim> |
| 226 | </insert> | 228 | </insert> |
| 227 | 229 | ||
| @@ -257,20 +259,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -257,20 +259,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 257 | <if test="creditStatus != null">credit_status = #{creditStatus},</if> | 259 | <if test="creditStatus != null">credit_status = #{creditStatus},</if> |
| 258 | <if test="qrCode != null">qr_code = #{qrCode},</if> | 260 | <if test="qrCode != null">qr_code = #{qrCode},</if> |
| 259 | <if test="lengthWidthHeight != null">length_width_height = #{lengthWidthHeight},</if> | 261 | <if test="lengthWidthHeight != null">length_width_height = #{lengthWidthHeight},</if> |
| 262 | + <if test="isDel != null">is_del = #{isDel},</if> | ||
| 260 | </trim> | 263 | </trim> |
| 261 | where id = #{id} | 264 | where id = #{id} |
| 262 | </update> | 265 | </update> |
| 263 | 266 | ||
| 264 | - <delete id="deleteCarInfoById" parameterType="Long"> | ||
| 265 | - delete from car_info where id = #{id} | ||
| 266 | - </delete> | 267 | + <update id="deleteCarInfoById" parameterType="Long"> |
| 268 | + update car_info set is_del = 0 where id = #{id} | ||
| 269 | + </update> | ||
| 267 | 270 | ||
| 268 | - <delete id="deleteCarInfoByIds" parameterType="String"> | ||
| 269 | - delete from car_info where id in | 271 | + <update id="deleteCarInfoByIds" parameterType="String"> |
| 272 | + update car_info set is_del = 0 where id in | ||
| 270 | <foreach item="id" collection="array" open="(" separator="," close=")"> | 273 | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| 271 | #{id} | 274 | #{id} |
| 272 | </foreach> | 275 | </foreach> |
| 273 | - </delete> | 276 | + </update> |
| 274 | 277 | ||
| 275 | 278 | ||
| 276 | <insert id="addCarDriverRelation" parameterType="CarDriverRelation"> | 279 | <insert id="addCarDriverRelation" parameterType="CarDriverRelation"> |