|
|
@@ -1749,12 +1749,16 @@
|
|
|
SELECT
|
|
|
count( 0 ) AS "orderNumber",
|
|
|
b.licenseno as "licenseno",
|
|
|
- b.frameno as "frameno"
|
|
|
+ b.frameno as "frameno",
|
|
|
+ b.modelCode as "modelCode",
|
|
|
+ b.modelcname as "modelcname"
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
io.orderstatus AS orderstatus,
|
|
|
io.frameno AS frameno,
|
|
|
+ REPLACE(JSON_EXTRACT(io.carinfo, '$.engineNo'), '"', '') as "modelCode",
|
|
|
+ REPLACE(JSON_EXTRACT(io.carinfo, '$.modelcname'), '"', '') as "modelcname",
|
|
|
ifnull(io.licenseno, '') AS licenseno
|
|
|
FROM
|
|
|
ins_orders io
|
|
|
@@ -1787,11 +1791,16 @@
|
|
|
<if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
|
</if>
|
|
|
+ <if test="vo.year != null and vo.year!='' ">
|
|
|
+ AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
) b
|
|
|
GROUP BY
|
|
|
b.licenseno,
|
|
|
- b.frameno
|
|
|
+ b.frameno,
|
|
|
+ b.modelCode,
|
|
|
+ b.modelcname
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrdersGroupByLicenseno" resultType="com.ydtech.modules.admin.model.report.company.OrdersDataDto">
|
|
|
@@ -1838,38 +1847,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="querOrdersamountTo" resultType="com.ydtech.modules.admin.model.report.company.OrdersDataDto">
|
|
|
- select sum(a.orderNumber) as "orderNumber",
|
|
|
- sum(a.orderStatus3) / sum(a.orderNumber) AS "closeRate",
|
|
|
- count(a.frameno) as "frameno"
|
|
|
- from (
|
|
|
+ select sum(a.orderNumber) as "orderNumber",
|
|
|
+ count(a.licenseno) as "b.frameno"
|
|
|
+ from (
|
|
|
SELECT
|
|
|
count( 0 ) AS "orderNumber",
|
|
|
- SUM( CASE WHEN orderstatus = '3' THEN 1 ELSE 0 END ) AS "orderStatus3",
|
|
|
+ b.licenseno as "licenseno",
|
|
|
b.frameno as "frameno"
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
io.orderstatus AS orderstatus,
|
|
|
- ifnull(io.licenseno, '') AS licenseno,
|
|
|
io.frameno AS frameno,
|
|
|
- ifnull(
|
|
|
- (
|
|
|
- SELECT
|
|
|
- ifnull( inscompany, '' )
|
|
|
- FROM
|
|
|
- ins_area_company
|
|
|
- WHERE
|
|
|
- orderno = io.orderno
|
|
|
- AND io.orderstatus = 3
|
|
|
- AND orderstatus = 3
|
|
|
- ORDER BY
|
|
|
- createtime DESC
|
|
|
- LIMIT 1
|
|
|
- ), ''
|
|
|
- ) AS inscompany
|
|
|
+ ifnull(io.licenseno, '') AS licenseno
|
|
|
FROM
|
|
|
ins_orders io
|
|
|
- LEFT JOIN sys_user su on io.userid=su.id
|
|
|
+ LEFT JOIN sys_user su on io.userid=su.id
|
|
|
<where>
|
|
|
1=1
|
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
@@ -1900,11 +1893,9 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
) b
|
|
|
- GROUP BY
|
|
|
- b.frameno,
|
|
|
+ GROUP BY
|
|
|
b.licenseno,
|
|
|
- b.inscompany,
|
|
|
- b.orderstatus
|
|
|
+ b.frameno
|
|
|
) a
|
|
|
</select>
|
|
|
|
|
|
@@ -2138,6 +2129,9 @@
|
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
</if>
|
|
|
+ <if test="vo.year != null and vo.year!='' ">
|
|
|
+ AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="queryAgencyUserInsAreaPage" resultType="com.ydtech.modules.admin.model.vo.AgencyUserInsAreaVo">
|
|
|
@@ -2171,6 +2165,93 @@
|
|
|
|
|
|
</select>
|
|
|
|
|
|
+ <select id="querOrdersDataListExcel" resultType="com.ydtech.modules.admin.model.dto.OrdersDataExcel">
|
|
|
+ select a.*,
|
|
|
+ IFNULL(b.orderNumber,0)/IFNULL(a.orderNumber ,0)
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ count( 0 ) AS "orderNumber",
|
|
|
+ b.licenseno as "licenseno",
|
|
|
+ b.modelCode as "modelCode",
|
|
|
+ b.modelcname as "modelcname",
|
|
|
+ b.frameno as "frameno"
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ io.orderstatus AS orderstatus,
|
|
|
+ io.frameno AS frameno,
|
|
|
+ REPLACE(JSON_EXTRACT(io.carinfo, '$.engineNo'), '"', '') as "modelCode",
|
|
|
+ REPLACE(JSON_EXTRACT(io.carinfo, '$.modelcname'), '"', '') as "modelcname",
|
|
|
+ ifnull(io.licenseno, '') AS licenseno
|
|
|
+ FROM
|
|
|
+ ins_orders io
|
|
|
+ LEFT JOIN sys_user su on io.userid=su.id
|
|
|
+ <where>
|
|
|
+ 1=1
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
+ AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="vo.licenseno != null and vo.licenseno!='' ">
|
|
|
+ AND io.licenseno =#{vo.licenseno}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="vo.userId != null and vo.userId!='' ">
|
|
|
+ AND io.userid =#{vo.userId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="vo.userName != null and vo.userName!='' ">
|
|
|
+ AND su.name =#{vo.userName}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="vo.mobile != null and vo.mobile!='' ">
|
|
|
+ AND su.mobile =#{vo.mobile}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="vo.frameno != null and vo.frameno!='' ">
|
|
|
+ AND io.frameno =#{vo.frameno}
|
|
|
+ </if>
|
|
|
+ <if test="vo.deptId != null and vo.deptId!='' ">
|
|
|
+ and io.deptid like concat('%', #{vo.deptId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="vo.year != null and vo.year!='' ">
|
|
|
+ AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) b
|
|
|
+ GROUP BY
|
|
|
+ b.licenseno,
|
|
|
+ b.frameno,
|
|
|
+ b.modelCode,
|
|
|
+ b.modelcname
|
|
|
+ ) a
|
|
|
+ left join (
|
|
|
+ select count(0) as "orderNumber",
|
|
|
+ GROUP_CONCAT(inscompany ORDER BY inscompany SEPARATOR ',') as "namesimple",
|
|
|
+ io.licenseno as "licenseno"
|
|
|
+ from ins_area_company iac
|
|
|
+ left join ins_orders io on io.orderno = iac.orderno
|
|
|
+ <where>
|
|
|
+ 1=1
|
|
|
+ and iac.orderstatus ='3'
|
|
|
+ and io.orderstatus ='3'
|
|
|
+ <if test="vo.licenseno !=null and vo.licenseno!=''">
|
|
|
+ AND io.licenseno =#{vo.licenseno}
|
|
|
+ </if>
|
|
|
+ <if test="vo.frameno !=null and vo.frameno!=''">
|
|
|
+ AND io.frameno =#{vo.frameno}
|
|
|
+ </if>
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
+ AND io.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo.year != null and vo.year!='' ">
|
|
|
+ AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by
|
|
|
+ io.licenseno
|
|
|
+ ) b on b.licenseno =a.licenseno
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|