|
|
@ -5,8 +5,57 @@
|
|
|
|
<mapper namespace="com.ruoyi.jjh.ent.mapper.JHeadQuartersRevenueMapper">
|
|
|
|
<mapper namespace="com.ruoyi.jjh.ent.mapper.JHeadQuartersRevenueMapper">
|
|
|
|
<select id="page" resultType="com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue">
|
|
|
|
<select id="page" resultType="com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue">
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
DISTINCT credit_code as tyshxydm,
|
|
|
|
a.qymc,
|
|
|
|
a.qymc,
|
|
|
|
a.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)'
|
|
|
|
|
|
|
|
THEN '制造业总部'
|
|
|
|
|
|
|
|
WHEN a.hydm REGEXP '^(47|48|49|50)' THEN '建筑业总部'
|
|
|
|
|
|
|
|
WHEN a.hydm REGEXP '^(51|52|61|62)' THEN '批零住餐总部'
|
|
|
|
|
|
|
|
ELSE '服务业总部'
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
j_project b left join j_headquarters_revenue a on b.credit_code = a.tyshxydm
|
|
|
|
|
|
|
|
<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)'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.type == 2">
|
|
|
|
|
|
|
|
and a.hydm REGEXP '^(47|48|49|50)'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.type == 3">
|
|
|
|
|
|
|
|
and a.hydm REGEXP '^(51|52|61|62)'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.type == 4">
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="req.type == 5">
|
|
|
|
|
|
|
|
and a.hydm not REGEXP
|
|
|
|
|
|
|
|
'^(51|52|61|62|47|48|49|50|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)'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="page1" resultType="com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
a.qymc,
|
|
|
|
|
|
|
|
b.credit_code as tyshxydm,
|
|
|
|
CASE
|
|
|
|
CASE
|
|
|
|
WHEN a.hydm REGEXP
|
|
|
|
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)'
|
|
|
|
'^(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)'
|
|
|
@ -25,7 +74,7 @@
|
|
|
|
j_headquarters_revenue a
|
|
|
|
j_headquarters_revenue a
|
|
|
|
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
|
|
|
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
b.project_middle_type = 1
|
|
|
|
b.project_middle_type = 1 and b.status = 5
|
|
|
|
<if test="req.qymc != null and req.qymc != '' ">
|
|
|
|
<if test="req.qymc != null and req.qymc != '' ">
|
|
|
|
and a.qymc like concat('%',#{req.qymc},'%')
|
|
|
|
and a.qymc like concat('%',#{req.qymc},'%')
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
@ -55,22 +104,26 @@
|
|
|
|
and b.project_small_type = #{req.projectSmallType}
|
|
|
|
and b.project_small_type = #{req.projectSmallType}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
group by b.credit_code,a.qymc,type, a.hydm,
|
|
|
|
|
|
|
|
a.years
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="selectZbCount" resultType="com.ruoyi.jjh.ent.entity.response.JHqCountResponse">
|
|
|
|
<select id="selectZbCount" resultType="com.ruoyi.jjh.ent.entity.response.JHqCountResponse">
|
|
|
|
SELECT DISTINCT
|
|
|
|
SELECT
|
|
|
|
SUM(
|
|
|
|
NULL AS allCount,
|
|
|
|
IF
|
|
|
|
SUM(IF(distinct_projects.project_small_type = 1, 1, 0)) AS count1,
|
|
|
|
( b.project_small_type = 1, 1, 0 )) AS count1,
|
|
|
|
SUM(IF(distinct_projects.project_small_type = 2, 1, 0)) AS count2,
|
|
|
|
SUM(
|
|
|
|
SUM(IF(distinct_projects.project_small_type = 3, 1, 0)) AS count3
|
|
|
|
IF
|
|
|
|
FROM (
|
|
|
|
( b.project_small_type = 2, 1, 0 )) AS count2,
|
|
|
|
SELECT DISTINCT a.tyshxydm, b.project_small_type
|
|
|
|
sum(
|
|
|
|
FROM j_headquarters_revenue a
|
|
|
|
IF
|
|
|
|
|
|
|
|
( b.project_small_type = 3, 1, 0 )) AS count3
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
j_headquarters_revenue a
|
|
|
|
|
|
|
|
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
|
|
|
LEFT JOIN j_project b ON a.tyshxydm = b.credit_code
|
|
|
|
WHERE
|
|
|
|
WHERE b.project_middle_type = 1
|
|
|
|
b.project_middle_type = 1
|
|
|
|
) AS distinct_projects
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectAllCount" resultType="java.lang.Integer">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
COUNT(DISTINCT credit_code)
|
|
|
|
|
|
|
|
FROM j_project
|
|
|
|
|
|
|
|
where status = 5 and project_big_type = 1
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|
|
|
|