|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
<mapper namespace="com.ruoyi.jjh.ent.mapper.JHeadQuartersRevenueMapper">
|
|
|
|
|
<select id="page" resultType="com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue">
|
|
|
|
|
SELECT
|
|
|
|
|
DISTINCT credit_code as tyshxydm,
|
|
|
|
|
a.tyshxydm,
|
|
|
|
|
a.qymc,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN a.hydm REGEXP
|
|
|
|
@ -18,22 +18,17 @@
|
|
|
|
|
a.hydm,
|
|
|
|
|
IFNULL( ROUND( a.revenue / 10000, 1 ), '-' ) AS revenue,
|
|
|
|
|
IFNULL( ROUND( a.taxation / 10000, 1 ), '-' ) AS taxation,
|
|
|
|
|
a.years,
|
|
|
|
|
IFNULL( ROUND( a.output / 10000, 1 ), '-' ) AS output,
|
|
|
|
|
IFNULL( ROUND( a.sales / 10000, 1 ), '-' ) AS sales
|
|
|
|
|
FROM
|
|
|
|
|
j_project b left join j_headquarters_revenue a on b.credit_code = a.tyshxydm
|
|
|
|
|
j_headquarters_revenue a
|
|
|
|
|
<where>
|
|
|
|
|
b.status = 5 and b.project_big_type = 1
|
|
|
|
|
<if test="req.qymc != null and req.qymc != '' ">
|
|
|
|
|
and a.qymc like concat('%',#{req.qymc},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.tyshxydm != null and req.tyshxydm != '' ">
|
|
|
|
|
and a.tyshxydm = #{req.tyshxydm}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.years != null and req.years != '' ">
|
|
|
|
|
and a.years = #{req.years}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.type == 1">
|
|
|
|
|
and a.hydm REGEXP
|
|
|
|
|
'^(06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46)'
|
|
|
|
@ -55,34 +50,32 @@
|
|
|
|
|
<select id="page1" resultType="com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue">
|
|
|
|
|
SELECT
|
|
|
|
|
a.qymc,
|
|
|
|
|
b.credit_code as tyshxydm,
|
|
|
|
|
b.credit_code AS tyshxydm,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN a.hydm REGEXP
|
|
|
|
|
'^(06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46)'
|
|
|
|
|
WHEN a.hydm REGEXP '^(06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46)'
|
|
|
|
|
THEN '制造业总部'
|
|
|
|
|
WHEN a.hydm REGEXP '^(47|48|49|50)' THEN '建筑业总部'
|
|
|
|
|
WHEN a.hydm REGEXP '^(51|52|61|62)' THEN '批零住餐总部'
|
|
|
|
|
ELSE '服务业总部'
|
|
|
|
|
END as type,
|
|
|
|
|
END AS type,
|
|
|
|
|
a.hydm,
|
|
|
|
|
IFNULL( ROUND( a.revenue / 10000, 1 ), '-' ) AS revenue,
|
|
|
|
|
IFNULL( ROUND( a.taxation / 10000, 1 ), '-' ) AS taxation,
|
|
|
|
|
a.years,
|
|
|
|
|
IFNULL( ROUND( a.output / 10000, 1 ), '-' ) AS output,
|
|
|
|
|
IFNULL( ROUND( a.sales / 10000, 1 ), '-' ) AS sales
|
|
|
|
|
MAX(IFNULL(ROUND(a.revenue / 10000, 1), '-')) AS revenue,
|
|
|
|
|
MAX(IFNULL(ROUND(a.taxation / 10000, 1), '-')) AS taxation,
|
|
|
|
|
MAX(IFNULL(ROUND(a.output / 10000, 1), '-')) AS output,
|
|
|
|
|
MAX(IFNULL(ROUND(a.sales / 10000, 1), '-')) AS sales
|
|
|
|
|
FROM
|
|
|
|
|
j_headquarters_revenue a
|
|
|
|
|
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
SELECT DISTINCT credit_code, project_small_type
|
|
|
|
|
FROM j_project
|
|
|
|
|
WHERE project_middle_type = 1 AND status = 5
|
|
|
|
|
) b ON a.tyshxydm = b.credit_code
|
|
|
|
|
<where>
|
|
|
|
|
b.project_middle_type = 1 and b.status = 5
|
|
|
|
|
<if test="req.qymc != null and req.qymc != '' ">
|
|
|
|
|
and a.qymc like concat('%',#{req.qymc},'%')
|
|
|
|
|
AND a.qymc LIKE CONCAT('%', #{req.qymc}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.tyshxydm != null and req.tyshxydm != '' ">
|
|
|
|
|
and a.tyshxydm = #{req.tyshxydm}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.years != null and req.years != '' ">
|
|
|
|
|
and a.years = #{req.years}
|
|
|
|
|
AND a.tyshxydm = #{req.tyshxydm}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.type == 1">
|
|
|
|
|
and a.hydm REGEXP
|
|
|
|
@ -104,8 +97,7 @@
|
|
|
|
|
and b.project_small_type = #{req.projectSmallType}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
group by b.credit_code,a.qymc,type, a.hydm,
|
|
|
|
|
a.years,a.revenue,a.taxation,a.output,a.sales
|
|
|
|
|
GROUP BY a.qymc,b.credit_code, type, a.hydm
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectZbCount" resultType="com.ruoyi.jjh.ent.entity.response.JHqCountResponse">
|
|
|
|
|
SELECT
|
|
|
|
@ -122,8 +114,7 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectAllCount" resultType="java.lang.Integer">
|
|
|
|
|
SELECT
|
|
|
|
|
COUNT(DISTINCT credit_code)
|
|
|
|
|
FROM j_project
|
|
|
|
|
where status = 5 and project_big_type = 1
|
|
|
|
|
COUNT(*)
|
|
|
|
|
FROM j_headquarters_revenue
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|