| | |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | and t.party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND t1.class_id = #{queryDTO.queryArea} |
| | | <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> |
| | | AND t1.province = #{queryDTO.queryProvince} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND t1.export_service_attr = #{queryDTO.queryServiceAttr} |
| | |
| | | AND amount IS NOT NULL |
| | | AND sign_date IS NOT NULL |
| | | AND YEAR(sign_date) = #{queryDTO.year} |
| | | AND party_b_id IN (2089995177814495234,2089996921978040321,2089997578009128962) |
| | | AND party_b_id IN (2089995177814495234,2089996921978040321,2089997578009128962,2101966257365045249) |
| | | |
| | | GROUP BY party_b_id, party_b |
| | | |
| | |
| | | AND amount IS NOT NULL |
| | | AND sign_date IS NOT NULL |
| | | AND YEAR(sign_date) = #{queryDTO.year} |
| | | AND party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | ) AS pivot_table |
| | | GROUP BY party_b_name |
| | | ORDER BY |
| | |
| | | c.party_a, |
| | | c.party_b_id, |
| | | c.party_b, |
| | | c.party_c_id, |
| | | c.amount, |
| | | c.contract_type, |
| | | c.supply_attribute, |
| | |
| | | c.warranty_schedule_id, |
| | | c.comp_id, |
| | | c.center_push_flag, |
| | | c.annotate_flag, |
| | | c.last_attachment_url, |
| | | (select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = c.id) outAmount |
| | | FROM |
| | |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND c.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> |
| | | AND bc.class_id = #{queryDTO.queryArea} |
| | | <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> |
| | | AND bc.province = #{queryDTO.queryProvince} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND bc.export_service_attr = #{queryDTO.queryServiceAttr} |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089995177814495234 |
| | | AND c.sign_date >= CURDATE() |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | | SELECT |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089995177814495234 |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' )) smjby, |
| | | ( |
| | | SELECT |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089995177814495234 |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >=DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' )) smjbn, |
| | | ( |
| | |
| | | c.create_time |
| | | |
| | | </select> |
| | | <select id="zbjtStatisticByContract" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | ) AS br, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' ) |
| | | ) AS bm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bn |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmount" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS smj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS sgb, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS tfgs, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jxc, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS ymj |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountPro" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountProVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089995177814495234 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS mj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2101966257365045249 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS hwc, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089997578009128962 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zt, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089996921978040321 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS scd, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS gyb, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2056556421857497090 or comp_id = 2056556317461270529 or comp_id = 2056556535640576002 ) |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS qt |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountClass" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountClassVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jz, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '3' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS wb |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountSupply" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountSupplyVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS cp, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS dx, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='3' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS qt |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountYS" |
| | | resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountClassVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jz, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '3' |
| | | and c.billing_amout >= c.paid_amount |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS wb |
| | | </select> |
| | | <select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE( #{startMon} ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_ADD( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start < DATE( #{endMon} ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start; |
| | | </select> |
| | | <select id="zbjtPlanAchieced" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND c.del_flag = '0' |
| | | <if test="compId !=null"> |
| | | AND c.comp_id = #{compId} |
| | | </if> |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="zbjtPlanAchiecedSmj" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="export" resultType="com.by4cloud.platformx.business.vo.ContractExportExceVO"> |
| | | SELECT |
| | | c.id, |
| | | c.contract_no, |
| | | c.contract_name, |
| | | c.party_a_id, |
| | | c.party_a, |
| | | c.party_b_id, |
| | | c.party_b, |
| | | c.party_c_id, |
| | | c.amount, |
| | | c.contract_type, |
| | | c.supply_attribute, |
| | | c.contract_status, |
| | | c.contract_attribute, |
| | | c.sign_date, |
| | | c.sign_place, |
| | | c.effective_date, |
| | | c.delivery_cycle, |
| | | c.expiration_date, |
| | | c.attachment_url, |
| | | c.remark, |
| | | c.parent_id, |
| | | c.approve_time, |
| | | c.arrival_schedule_id, |
| | | c.accept_schedule_id, |
| | | c.billing_status, |
| | | c.billing_amout, |
| | | c.template_id, |
| | | c.sales_model, |
| | | c.paid_amount, |
| | | c.contract_category, |
| | | c.economic_matters, |
| | | c.exec_frequency, |
| | | c.next_schedule_name, |
| | | c.warranty_schedule_id, |
| | | c.comp_id, |
| | | c.center_push_flag, |
| | | c.last_attachment_url |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | <if test="queryDTO.contractName !=null and queryDTO.contractName !=''"> |
| | | AND contract_name LIKE CONCAT('%', #{queryDTO.contractName}, '%') |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | AND party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.contractStatus !=null and queryDTO.contractStatus !=''"> |
| | | AND contract_status = #{queryDTO.contractStatus} |
| | | </if> |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND c.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> |
| | | AND bc.province = #{queryDTO.queryProvince} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND bc.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND c.sign_date >= #{queryDTO.startTime} |
| | | AND c.sign_date <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | c.create_time DESC |
| | | </select> |
| | | <select id="homeZbjtYearAndMon" resultType="com.by4cloud.platformx.business.vo.HomeZbjtVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= #{startMon} |
| | | AND c.sign_date < #{endMon}) sgbby, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= #{startYear} |
| | | AND c.sign_date < #{endYear}) sgbbn, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >= #{startMon} |
| | | AND c.sign_date < #{endMon}) smjby, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >= #{startYear} |
| | | AND c.sign_date < #{endYear}) smjbn, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >= #{startMon} |
| | | AND c.sign_date < #{endMon}) jxcby, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >= #{startYear} |
| | | AND c.sign_date < #{endYear}) jxcbn, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >= #{startMon} |
| | | AND c.sign_date < #{endMon}) tfby, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >= #{startYear} |
| | | AND c.sign_date < #{endYear}) tfbn, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >= #{startMon} |
| | | AND c.sign_date < #{endMon}) ymjby, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >= #{startYear} |
| | | AND c.sign_date < #{endYear}) ymjbn |
| | | </select> |
| | | <select id="pjsxywwcqkHT" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo"> |
| | | SELECT |
| | | '配件' yw, |
| | | '新增合同' lb, |
| | | '石煤机' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 ) UNION ALL |
| | | SELECT |
| | | '配件' yw, |
| | | '新增合同' lb, |
| | | '石工泵' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556196124250113 UNION ALL |
| | | SELECT |
| | | '配件' yw, |
| | | '新增合同' lb, |
| | | '邢台厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556317461270529 UNION ALL |
| | | SELECT |
| | | '配件' yw, |
| | | '新增合同' lb, |
| | | '通方厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556421857497090 |
| | | </select> |
| | | <select id="cksxywwcqkHT" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo"> |
| | | SELECT |
| | | '出口' yw, |
| | | '新增合同' lb, |
| | | '石煤机' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | left join business_customer bc on bc.id=c.party_a_id and bc.export_service_attr=#{type} |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 ) UNION ALL |
| | | SELECT |
| | | '出口' yw, |
| | | '新增合同' lb, |
| | | '石工泵' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | left join business_customer bc on bc.id=c.party_a_id and bc.export_service_attr=#{type} |
| | | |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556196124250113 UNION ALL |
| | | SELECT |
| | | '出口' yw, |
| | | '新增合同' lb, |
| | | '邢台厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | left join business_customer bc on bc.id=c.party_a_id and bc.export_service_attr=#{type} |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556317461270529 UNION ALL |
| | | SELECT |
| | | '出口' yw, |
| | | '新增合同' lb, |
| | | '通方厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | left join business_customer bc on bc.id=c.party_a_id and bc.export_service_attr=#{type} |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556421857497090 |
| | | </select> |
| | | <select id="dxsxywwcqkHT" resultType="com.by4cloud.platformx.business.vo.GcpbkwcqkItemVo"> |
| | | SELECT |
| | | '大修' yw, |
| | | '新增合同' lb, |
| | | '石煤机' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND ( c.comp_id = 2089995177814495234 OR c.comp_id = 2089996921978040321 OR c.comp_id = 2089997578009128962 OR c.comp_id = 2101966257365045249 ) UNION ALL |
| | | SELECT |
| | | '大修' yw, |
| | | '新增合同' lb, |
| | | '石工泵' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556196124250113 UNION ALL |
| | | SELECT |
| | | '大修' yw, |
| | | '新增合同' lb, |
| | | '邢台厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556317461270529 UNION ALL |
| | | SELECT |
| | | '大修' yw, |
| | | '新增合同' lb, |
| | | '通方厂' dw, |
| | | IFNULL( sum( amount ), 0 ) wc |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute = #{type} |
| | | AND c.sign_date >= #{monstart} |
| | | AND c.sign_date <= #{monend} |
| | | AND c.comp_id = 2056556421857497090 |
| | | </select> |
| | | </mapper> |