Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
6add0b51
Commit
6add0b51
authored
Sep 24, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车型列表
parent
16ee86e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
56 deletions
+53
-56
VehicleModelQueryCondition.java
...xfc/platform/vehicle/pojo/VehicleModelQueryCondition.java
+1
-4
VehicleModelMapper.xml
...e-server/src/main/resources/mapper/VehicleModelMapper.xml
+52
-52
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleModelQueryCondition.java
View file @
6add0b51
...
...
@@ -27,14 +27,11 @@ public class VehicleModelQueryCondition {
@ApiModelProperty
(
value
=
"是否删除"
)
private
Integer
isDel
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
private
Integer
status
=
1
;
@ApiModelProperty
(
"分类逗号分割"
)
String
catasStr
;
@ApiModelProperty
(
"排除的车型id"
)
String
notInIds
;
@ApiModelProperty
(
value
=
"分类列表"
,
hidden
=
true
)
Map
<
Integer
,
List
<
VehiclePlatCata
>>
catas
;
@ApiModelProperty
(
value
=
"分类列表(1-后台,2-app和小程序)"
,
hidden
=
true
)
private
Integer
pathType
=
2
;
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleModelMapper.xml
View file @
6add0b51
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleModelMapper"
>
<select
id=
"findVehicleModelPage"
parameterType=
"com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleModelVo"
>
SELECT * from
(select vm.*,v.sum,v2.leasableQuantity,vpc.`name` brandName,vpc2.name numberName from vehicle_model
vm left JOIN
(select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid)
v
on vm.id=v.mid left JOIN
(select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id)
v2
on v.mid=v2.mid2
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc on vm.brand=vpc.id
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc2 on vm.number=vpc2.id
where
isdel = 0
) vmqc WHERE 1=1
<select
id=
"findVehicleModelPage"
parameterType=
"com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleModelVo"
>
SELECT * from
(select vm.*,v.sum,v2.leasableQuantity,vpc.`name` brandName,vpc2.name numberName from vehicle_model
vm left JOIN
(select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid)
v
on vm.id=v.mid left JOIN
(select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id)
v2
on v.mid=v2.mid2
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc on vm.brand=vpc.id
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc2 on vm.number=vpc2.id
where
isdel = 0
) vmqc WHERE 1=1
<if
test=
"isDel !=null "
>
and isdel=#{isDel}
</if>
<if
test=
"pathType ==2"
>
and status = 1
</if>
<if
test=
"pathType!=2"
>
<if
test=
"status != null"
>
and status = #{status}
</if>
</if>
<if
test=
"isDel !=null "
>
and isdel=#{isDel}
</if>
<if
test=
"vehicleName !=null and vehicleName !=''"
>
AND vmqc.name LIKE CONCAT('%',#{vehicleName},'%')
</if>
<if
test=
"vehicleType!=null and vehicleType!=''
"
>
AND EXISTS (SELECT vc.vehicle_model_id FROM vehicle_cata vc WHERE vc.cata_id=#{vehicleType} AND vmqc.id=vc.vehicle_model_id )
</if>
<if
test=
"status != null
"
>
and status = #{status}
</if>
<if
test=
"takeALieTheNumber!=null and takeALieTheNumber!=''"
>
AND EXISTS(SELECT vc2.vehicle_model_id FROM vehicle_cata vc2 WHERE vc2.cata_id=#{takeALieTheNumber} AND vmqc.id=vc2.vehicle_model_id)
</if>
<if
test=
"catas != null"
>
AND ( 1
<foreach
collection=
"catas"
index=
"key"
item=
"cataList"
>
&
(
<foreach
collection=
"cataList"
index=
"cIndex"
item=
"cata"
>
<if
test=
" cIndex != 0"
>
|
</if>
(case when FIND_IN_SET(#{cata.id},vmqc.config) > 0 then 1 else 0 end)
</foreach>
)
</foreach>
) > 0
</if>
<if
test=
"notInIds != null"
>
and vmqc.id not in (
<if
test=
"vehicleName !=null and vehicleName !=''"
>
AND vmqc.name LIKE CONCAT('%',#{vehicleName},'%')
</if>
<if
test=
"vehicleType!=null and vehicleType!=''"
>
AND EXISTS (SELECT vc.vehicle_model_id FROM vehicle_cata vc WHERE vc.cata_id=#{vehicleType} AND
vmqc.id=vc.vehicle_model_id )
</if>
<if
test=
"takeALieTheNumber!=null and takeALieTheNumber!=''"
>
AND EXISTS(SELECT vc2.vehicle_model_id FROM vehicle_cata vc2 WHERE vc2.cata_id=#{takeALieTheNumber} AND
vmqc.id=vc2.vehicle_model_id)
</if>
<if
test=
"catas != null"
>
AND ( 1
<foreach
collection=
"catas"
index=
"key"
item=
"cataList"
>
&
(
<foreach
collection=
"cataList"
index=
"cIndex"
item=
"cata"
>
<if
test=
" cIndex != 0"
>
|
</if>
(case when FIND_IN_SET(#{cata.id},vmqc.config) > 0 then 1 else 0 end)
</foreach>
)
</foreach>
) > 0
</if>
<if
test=
"notInIds != null"
>
and vmqc.id not in (
<foreach
collection=
"notInIds.split(',')"
item=
"noIdItem"
index=
"noIdIndex"
>
#{noIdItem}
</foreach>
)
</if>
ORDER BY
vmqc.sort ASC
</select>
)
</if>
ORDER BY
vmqc.sort ASC
</select>
<update
id=
"updateScoreByModelIdAndavgScore"
>
update `vehicle_model` set `score`=(`score`+#{avgScore})/2 where `id`=#{modelId}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment