Commit d3d0c79a authored by jiaorz's avatar jiaorz

车辆信息统计

parent f49101e4
...@@ -3,8 +3,14 @@ ...@@ -3,8 +3,14 @@
<mapper namespace="com.xxfc.platform.vehicle.mapper.BranchCompanyVehicleCountMapper" > <mapper namespace="com.xxfc.platform.vehicle.mapper.BranchCompanyVehicleCountMapper" >
<select id="getAllCountInfo" parameterType="Map" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo"> <select id="getAllCountInfo" parameterType="Map" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo">
SELECT c.company_id, c.count_year, c.count_month,c.count_date, b.`name` as companyName,sum(c.vehicle_num) as vehicle_num from branch_company_vehicle_count c SELECT
LEFT JOIN branch_company b on b.id = c.company_id c.company_id as companyId,
c.count_date as countDate,
b.`name` AS companyName,
sum(c.vehicle_num) as vehicleNum
FROM
branch_company_vehicle_count c
LEFT JOIN branch_company b ON b.id = c.company_id
<where> <where>
<if test = "companyId != null"> <if test = "companyId != null">
and c.company_id = #{companyId} and c.company_id = #{companyId}
...@@ -16,7 +22,8 @@ ...@@ -16,7 +22,8 @@
and c.count_date &lt;= #{endTime} and c.count_date &lt;= #{endTime}
</if> </if>
</where> </where>
GROUP BY c.company_id,c.count_date GROUP BY c.id
ORDER BY c.company_id
</select> </select>
<select id="countByMonth" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo" parameterType="Map"> <select id="countByMonth" resultType="com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo" parameterType="Map">
......
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