|
|
|
<?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.kms.build.mapper.BsSgcjsjdBuiProInfoMapper">
|
|
|
|
|
|
|
|
<sql id="info">
|
|
|
|
select pi.id,
|
|
|
|
pp.project_name,
|
|
|
|
pi.pro_code,
|
|
|
|
pp.adcd,
|
|
|
|
pi.project_type,
|
|
|
|
pi.CONSTRUCTION_NATURE,
|
|
|
|
pi.is_major,
|
|
|
|
pi.total,
|
|
|
|
pi.pro_no
|
|
|
|
from bs_sgc_jsjd_bui_pro_info pi
|
|
|
|
left join bs_slgc_qqjd_spe_pro_proposal pp on pi.pro_code = pp.project_code and pi.pro_no = pp.pro_no
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<sql id="projectMangeInfo">
|
|
|
|
select pi.id,
|
|
|
|
pp.project_name,
|
|
|
|
pi.pro_code,
|
|
|
|
pp.adcd,
|
|
|
|
pi.project_type,
|
|
|
|
pi.CONSTRUCTION_NATURE,
|
|
|
|
pi.is_major,
|
|
|
|
pi.total,
|
|
|
|
pp.COMPILING_UNIT,
|
|
|
|
pp.IS_BELONG_PLANNING,
|
|
|
|
pi.pro_no
|
|
|
|
from bs_sgc_jsjd_bui_pro_info pi left join bs_slgc_qqjd_spe_pro_proposal pp
|
|
|
|
on pi.pro_code = pp.project_code and pi.pro_no = pp.pro_no
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<sql id="AssertStatisticsInfo">
|
|
|
|
SELECT
|
|
|
|
pi.id,
|
|
|
|
pp.PROJECT_NAME,
|
|
|
|
pp.PROJECT_TYPE,
|
|
|
|
pp.adcd,
|
|
|
|
pi.total ,
|
|
|
|
pi.is_major,
|
|
|
|
ifnull(SUM(sf.CENTRAL_ARRANGED_FUNDS),0) CENTRAL_ARRANGED_FUNDS,
|
|
|
|
ifnull(SUM(sf.PROVINCIAL_FUNDING),0) PROVINCIAL_FUNDING,
|
|
|
|
ifnull(SUM(sf.CITY_LEVEL_FUNDS),0) CITY_LEVEL_FUNDS,
|
|
|
|
ifnull(SUM(sf.COUNTY_LEVEL_FUNDS),0) COUNTY_LEVEL_FUNDS,
|
|
|
|
ifnull(SUM(sf.TOWNSHIP_INVESTMENTS),0) TOWNSHIP_INVESTMENTS,
|
|
|
|
ifnull(SUM(sf.release_funds),0) Source_total,
|
|
|
|
ifnull(SUM(ci.center_paidin_amount),0) center_paidin_amount,
|
|
|
|
ifnull(SUM(ci.provincial_paidin_amount),0) provincial_paidin_amount,
|
|
|
|
ifnull(SUM(ci.city_paidin_amount),0) city_paidin_amount,
|
|
|
|
ifnull(SUM(ci.county_paidin_amount),0) county_paidin_amount,
|
|
|
|
ifnull(SUM(ci.township_paidin_amount),0) township_paidin_amount,
|
|
|
|
ifnull(SUM(ci.actual_payment),0) actual_payment,
|
|
|
|
pp.project_code,
|
|
|
|
pp.pro_no
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_pro_info pi
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_purpose_funds pf ON pi.PRO_CODE=pf.PRO_CODE and pi.PRO_NO=pf.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_cont_info ci on ci.PRO_CODE=pi.PRO_CODE and pi.PRO_NO=ci.PRO_NO
|
|
|
|
LEFT JOIN bs_slgc_qqjd_spe_pro_proposal pp on pp.PROJECT_CODE=pi.PRO_CODE and pi.PRO_NO=pp.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_source_funds sf on sf.PRO_CODE=pi.PRO_CODE and pi.PRO_NO=sf.PRO_NO
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<resultMap id="BsSgcjsjdBuiProInfo" type="BsSgcjsjdBuiProInfo">
|
|
|
|
<id property="id" column="id"/>
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="adcd" column="adcd"/>
|
|
|
|
<result property="projectType" column="project_type"/>
|
|
|
|
<result property="proCode" column="pro_code"/>
|
|
|
|
<result property="constructionNature" column="CONSTRUCTION_NATURE"/>
|
|
|
|
<result property="total" column="total"/>
|
|
|
|
<result property="proNo" column="pro_no"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="AssertStatistics" type="AssertStatisticsDto">
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="adcd" column="adcd"/>
|
|
|
|
<result property="purposeProvince" column="provincial_paidin_amount"/>
|
|
|
|
<result property="purposeCity" column="city_paidin_amount"/>
|
|
|
|
<result property="purposeCounty" column="county_paidin_amount"/>
|
|
|
|
<result property="purposeTotal" column="actual_payment"/>
|
|
|
|
<result property="purposeTown" column="township_paidin_amount"/>
|
|
|
|
<result property="purposeCenter" column="center_paidin_amount"/>
|
|
|
|
<result property="proNo" column="pro_no"/>
|
|
|
|
<result property="proCode" column="project_code"/>
|
|
|
|
<result property="projectType" column="project_type"/>
|
|
|
|
<result property="total" column="total"/>
|
|
|
|
<result property="sourceProvince" column="PROVINCIAL_FUNDING"/>
|
|
|
|
<result property="sourceCity" column="CITY_LEVEL_FUNDS"/>
|
|
|
|
<result property="sourceCounty" column="COUNTY_LEVEL_FUNDS"/>
|
|
|
|
<result property="sourceTown" column="TOWNSHIP_INVESTMENTS"/>
|
|
|
|
<result property="sourceCenter" column="CENTRAL_ARRANGED_FUNDS"/>
|
|
|
|
<result property="sourceTotal" column="Source_total"/>
|
|
|
|
<result property="isMajor" column="is_major"/>
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="projectManage" type="BsSgcjsjdBuiProInfo">
|
|
|
|
<id property="id" column="id"/>
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="adcd" column="adcd"/>
|
|
|
|
<result property="projectType" column="project_type"/>
|
|
|
|
<result property="unit" column="COMPILING_UNIT"/>
|
|
|
|
<result property="proCode" column="pro_code"/>
|
|
|
|
<result property="constructionNature" column="CONSTRUCTION_NATURE"/>
|
|
|
|
<result property="isBelong" column="IS_BELONG_PLANNING"/>
|
|
|
|
<result property="total" column="total"/>
|
|
|
|
<result property="proNo" column="pro_no"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getXzqh" resultMap="BsSgcjsjdBuiProInfo">
|
|
|
|
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
|
|
|
|
<include refid="info"/>
|
|
|
|
<where>
|
|
|
|
<if test="projectName!=null and projectName!=''">
|
|
|
|
and project_name like concat('%',#{projectName},'%')
|
|
|
|
</if>
|
|
|
|
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
|
|
|
|
</where>
|
|
|
|
order by pi.${orderBy} desc LIMIT #{pageNum},#{pageSize};
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getByUserPro" resultMap="BsSgcjsjdBuiProInfo">
|
|
|
|
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
|
|
|
|
<include refid="info"/>
|
|
|
|
<if test="userType==01">
|
|
|
|
WHERE
|
|
|
|
pi.PRO_NO IN (
|
|
|
|
SELECT
|
|
|
|
PRO_NO
|
|
|
|
FROM
|
|
|
|
sys_user_pro
|
|
|
|
<where>
|
|
|
|
<if test="userId!=null and userId!=''">
|
|
|
|
AND user_id=#{userId})
|
|
|
|
</if>
|
|
|
|
<if test="projectName!=null and projectName!=''">
|
|
|
|
and project_name like concat('%',#{projectName},'%')
|
|
|
|
</if>
|
|
|
|
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
|
|
|
|
</where>
|
|
|
|
order by pi.${orderBy} desc LIMIT #{pageNum},#{pageSize};
|
|
|
|
</if>
|
|
|
|
<if test="userType==00">
|
|
|
|
<where>
|
|
|
|
<if test="projectName!=null and projectName!=''">
|
|
|
|
and project_name like concat('%',#{projectName},'%')
|
|
|
|
</if>
|
|
|
|
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
|
|
|
|
</where>
|
|
|
|
order by pi.${orderBy} desc LIMIT #{pageNum},#{pageSize};
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectManagePage" resultMap="projectManage">
|
|
|
|
|
|
|
|
<include refid="projectMangeInfo"></include>
|
|
|
|
<where>
|
|
|
|
<if test="projectName!=null and projectName!=''">
|
|
|
|
and pi.project_name like concat('%',#{projectName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="isMajor!=null and isMajor!=''">
|
|
|
|
and pi.is_major=#{isMajor}
|
|
|
|
</if>
|
|
|
|
<if test="projectType!=null and projectType!=''">
|
|
|
|
and pi.project_type=#{projectType}
|
|
|
|
</if>
|
|
|
|
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
|
|
|
|
</where>
|
|
|
|
order by pi.${orderBy} desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectPageByCode" resultMap="AssertStatistics">
|
|
|
|
|
|
|
|
<include refid="AssertStatisticsInfo"></include>
|
|
|
|
<where>
|
|
|
|
<if test="projectName!=null and projectName!=''">
|
|
|
|
and pp.project_name like concat('%',#{projectName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="isMajor!=null and isMajor!=''">
|
|
|
|
and pi.is_major=#{isMajor}
|
|
|
|
</if>
|
|
|
|
<if test="projectType!=null and projectType!=''">
|
|
|
|
and pp.project_type=#{projectType}
|
|
|
|
</if>
|
|
|
|
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
|
|
|
|
</where>
|
|
|
|
GROUP BY pi.PRO_CODE
|
|
|
|
order by pi.${orderBy} desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<resultMap id="Gzjb" type="com.kms.build.domain.dto.GzjbDto">
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="adcd" column="adcd"/>
|
|
|
|
<result property="engineeringGrade" column="engineering_grade"/>
|
|
|
|
<result property="farmerTotal" column="farmer_total"/>
|
|
|
|
<result property="farmerNow" column="farmer_now"/>
|
|
|
|
<result property="farmerYear" column="farmer_year"/>
|
|
|
|
<result property="zfTotal" column="zf_total"/>
|
|
|
|
<result property="zfLandPaidnAmount" column="zf_land_paidn_amount"/>
|
|
|
|
<result property="zfCenterPaidinAmount" column="zf_center_paidin_amount"/>
|
|
|
|
<result property="xdTotal" column="zd_total"/>
|
|
|
|
<result property="xdLandPaidnAmount" column="zd_land_paidn_amount"/>
|
|
|
|
<result property="xdCenterPaidinAmount" column="zd_center_paidin_amount"/>
|
|
|
|
<result property="isStart" column="is_start"/>
|
|
|
|
<result property="isEnd" column="is_end"/>
|
|
|
|
<result property="startTime" column="start_time"/>
|
|
|
|
<result property="endTime" column="end_time"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
<result property="proCode" column="pro_code"/>
|
|
|
|
<result property="bidTime" column="bid_time"/>
|
|
|
|
<result property="proNo" column="pro_no"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="jb">
|
|
|
|
SELECT
|
|
|
|
t.ENGINEERING_GRADE,
|
|
|
|
t.PRO_NO,
|
|
|
|
t.PRO_CODE,
|
|
|
|
pp.ADCD,
|
|
|
|
pp.IS_BELONG_PLANNING,
|
|
|
|
t.commencement_date,
|
|
|
|
ca.COMPLETION_ACCEPTANCE_TIME,
|
|
|
|
pbi.REPORT_TIME,
|
|
|
|
SUM(sf.release_funds) AS source_total,
|
|
|
|
SUM(sf.CENTRAL_ARRANGED_FUNDS) AS source_center,
|
|
|
|
SUM(sf.PROVINCIAL_FUNDING + sf.CITY_LEVEL_FUNDS + sf.COUNTY_LEVEL_FUNDS + sf.TOWNSHIP_INVESTMENTS) AS source_land,
|
|
|
|
SUM(pf.center_paidin_amount+pf.provincial_paidin_amount+pf.city_paidin_amount+pf.county_paidin_amount+pf.township_paidin_amount) total
|
|
|
|
FROM
|
|
|
|
(SELECT ENGINEERING_GRADE, PRO_NO, PRO_CODE, commencement_date FROM bs_sgc_jsjd_bui_pro_info
|
|
|
|
WHERE CREATE_TIME BETWEEN '2024-01-01' AND '2024-04-01') t
|
|
|
|
LEFT JOIN bs_slgc_qqjd_spe_pro_proposal pp ON t.PRO_CODE = pp.PROJECT_CODE AND t.PRO_NO = pp.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_com_acc ca ON ca.PRO_CODE = t.PRO_CODE AND ca.PRO_NO = t.PRO_NO
|
|
|
|
LEFT JOIN bs_slgc_qqjd_pro_bid_info pbi ON pbi.PROJECT_CODE = t.PRO_CODE AND pbi.PRO_NO = t.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_source_funds sf ON sf.PRO_CODE = t.PRO_CODE AND sf.PRO_NO = t.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_cont_info ci ON ci.PRO_CODE = t.PRO_CODE AND ci.PRO_NO = t.PRO_NO
|
|
|
|
LEFT JOIN bs_sgc_jsjd_bui_purpose_funds pf ON ci.CONTRACT_NUMBER=pf.CONTRACT_NUMBER
|
|
|
|
GROUP BY t.PRO_CODE
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="list" resultMap="Gzjb">
|
|
|
|
SELECT
|
|
|
|
info.ENGINEERING_GRADE,
|
|
|
|
info.PRO_NO,
|
|
|
|
info.PRO_CODE,
|
|
|
|
pro.ADCD,
|
|
|
|
pro.IS_BELONG_PLANNING,
|
|
|
|
info.commencement_date,
|
|
|
|
pro.PROJECT_NAME,
|
|
|
|
ca.COMPLETION_ACCEPTANCE_TIME,
|
|
|
|
pbi.REPORT_TIME,
|
|
|
|
sf.source_total,
|
|
|
|
sf.source_center,
|
|
|
|
sf.source_land,
|
|
|
|
pf.total
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_pro_info info,
|
|
|
|
bs_slgc_qqjd_spe_pro_proposal pro
|
|
|
|
LEFT JOIN (
|
|
|
|
SELECT
|
|
|
|
COMPLETION_ACCEPTANCE_TIME,
|
|
|
|
PRO_NO,
|
|
|
|
pro_code
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_com_acc ca
|
|
|
|
WHERE
|
|
|
|
ca.CREATE_TIME > DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
|
|
|
|
AND ca.CREATE_TIME < DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
|
|
|
|
AND ca.PRO_NO = #{proNo}
|
|
|
|
AND ca.pro_code = #{proCode}
|
|
|
|
) ca ON ca.PRO_NO = pro.PRO_NO
|
|
|
|
AND ca.PRO_CODE = pro.PROJECT_CODE
|
|
|
|
LEFT JOIN (
|
|
|
|
SELECT
|
|
|
|
REPORT_TIME,
|
|
|
|
PRO_NO,
|
|
|
|
project_code
|
|
|
|
FROM
|
|
|
|
bs_slgc_qqjd_pro_bid_info pbi
|
|
|
|
WHERE
|
|
|
|
pbi.CREATE_TIME > DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
|
|
|
|
AND pbi.CREATE_TIME < DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
|
|
|
|
AND pbi.PRO_NO = #{proNo}
|
|
|
|
AND pbi.project_code = #{proCode}
|
|
|
|
) pbi ON pbi.PRO_NO = pro.PRO_NO
|
|
|
|
AND pbi.project_code = pro.PROJECT_CODE
|
|
|
|
LEFT JOIN (
|
|
|
|
SELECT
|
|
|
|
SUM( sf.release_funds ) AS source_total,
|
|
|
|
SUM( sf.CENTRAL_ARRANGED_FUNDS ) AS source_center,
|
|
|
|
SUM( sf.PROVINCIAL_FUNDING + sf.CITY_LEVEL_FUNDS + sf.COUNTY_LEVEL_FUNDS + sf.TOWNSHIP_INVESTMENTS ) AS source_land,
|
|
|
|
PRO_NO,
|
|
|
|
pro_code
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_source_funds sf
|
|
|
|
WHERE
|
|
|
|
sf.CREATE_TIME > DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
|
|
|
|
AND sf.CREATE_TIME < DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
|
|
|
|
AND sf.PRO_NO = #{proNo}
|
|
|
|
AND sf.pro_code = #{proCode}
|
|
|
|
) sf ON ca.PRO_NO = pro.PRO_NO
|
|
|
|
AND ca.PRO_CODE = pro.PROJECT_CODE
|
|
|
|
LEFT JOIN (
|
|
|
|
SELECT
|
|
|
|
CONTRACT_NUMBER,
|
|
|
|
PRO_NO,
|
|
|
|
pro_code
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_cont_info ci
|
|
|
|
WHERE
|
|
|
|
ci.CREATE_TIME > DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
|
|
|
|
AND ci.CREATE_TIME < DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
|
|
|
|
AND ci.PRO_NO = #{proNo}
|
|
|
|
AND ci.pro_code = #{proCode}
|
|
|
|
) ci ON ci.PRO_NO = pro.PRO_NO
|
|
|
|
AND ci.PRO_CODE = pro.PROJECT_CODE
|
|
|
|
LEFT JOIN (
|
|
|
|
SELECT
|
|
|
|
SUM( pf.center_paidin_amount + pf.provincial_paidin_amount + pf.city_paidin_amount + pf.county_paidin_amount + pf.township_paidin_amount ) total,
|
|
|
|
PRO_NO,
|
|
|
|
pro_code,
|
|
|
|
CONTRACT_NUMBER
|
|
|
|
FROM
|
|
|
|
bs_sgc_jsjd_bui_purpose_funds pf
|
|
|
|
WHERE
|
|
|
|
pf.CREATE_TIME > DATE_FORMAT( #{startDate},'%Y-%m-%d' )
|
|
|
|
AND pf.CREATE_TIME < DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
|
|
|
|
AND pf.PRO_NO = #{proNo}
|
|
|
|
AND pf.pro_code = #{proCode}
|
|
|
|
) pf ON ci.CONTRACT_NUMBER = pf.CONTRACT_NUMBER
|
|
|
|
WHERE
|
|
|
|
info.PRO_NO = pro.PRO_NO
|
|
|
|
AND info.PRO_CODE = pro.PROJECT_CODE
|
|
|
|
AND info.PRO_NO = #{proNo}
|
|
|
|
AND info.pro_code = #{proCode}
|
|
|
|
<if test="userType==01">
|
|
|
|
WHERE
|
|
|
|
pi.PRO_NO IN (
|
|
|
|
SELECT
|
|
|
|
PRO_NO
|
|
|
|
FROM
|
|
|
|
sys_user_pro
|
|
|
|
<where>
|
|
|
|
<if test="userId!=null and userId!=''">
|
|
|
|
AND user_id=#{userId})
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="adcd!=null and adcd !=''">
|
|
|
|
and adcd like concat(#{adcd},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
order by pi.${orderBy} desc
|
|
|
|
</if>
|
|
|
|
<if test="userType==00">
|
|
|
|
<where>
|
|
|
|
<if test="adcd!=null and adcd !=''">
|
|
|
|
and adcd like concat(#{adcd},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
GROUP BY info.PRO_CODE
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|