| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.area_id = b.area_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.area_id = b.area_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.area_id = b.area_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.area_id = b.area_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.area_id = b.area_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | contract c |
| | | JOIN business_customer b ON c.party_a_id = b.id |
| | | WHERE |
| | | b.area_id IS NOT NULL |
| | | c.del_flag='0' |
| | | AND b.area_id IS NOT NULL |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | GROUP BY |
| | | b.area_id |
| | |
| | | where |
| | | c1.del_flag = '0' |
| | | and c1.industry_code = c.industry_code |
| | | AND YEAR( sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | where |
| | | c1.del_flag = '0' |
| | | and c1.industry_code = c.industry_code |
| | | AND YEAR( sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | where |
| | | c1.del_flag = '0' |
| | | and c1.industry_code = c.industry_code |
| | | AND YEAR( sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | where |
| | | c1.del_flag = '0' |
| | | and c1.industry_code = c.industry_code |
| | | AND YEAR( sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | where |
| | | c1.del_flag = '0' |
| | | and c1.industry_code = c.industry_code |
| | | AND YEAR( sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | FROM |
| | | contract c |
| | | where |
| | | c.industry_code is not null |
| | | c.del_flag='0' |
| | | AND c.industry_code is not null |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | GROUP BY |
| | | c.industry_code |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = b.class_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = b.class_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = b.class_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = b.class_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = b.class_id |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | contract c |
| | | JOIN business_customer b ON c.party_a_id = b.id |
| | | WHERE |
| | | b.class_id IS NOT NULL |
| | | c.del_flag='0' |
| | | AND b.class_id IS NOT NULL |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | GROUP BY |
| | | b.class_id |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.export_service_attr = b.export_service_attr |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.export_service_attr = b.export_service_attr |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.export_service_attr = b.export_service_attr |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.export_service_attr = b.export_service_attr |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.export_service_attr = b.export_service_attr |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | contract c |
| | | JOIN business_customer b ON c.party_a_id = b.id |
| | | WHERE |
| | | b.export_service_attr IS NOT NULL |
| | | c.del_flag='0' |
| | | AND b.export_service_attr IS NOT NULL |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | GROUP BY |
| | | b.export_service_attr |
| | |
| | | WHERE |
| | | ct.del_flag = '0' |
| | | and ct.supply_attribute = c.supply_attribute |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | and ct.party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | WHERE |
| | | ct.del_flag = '0' |
| | | and ct.supply_attribute = c.supply_attribute |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | and ct.party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | WHERE |
| | | ct.del_flag = '0' |
| | | and ct.supply_attribute = c.supply_attribute |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | and ct.party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | WHERE |
| | | ct.del_flag = '0' |
| | | and ct.supply_attribute = c.supply_attribute |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | and ct.party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | WHERE |
| | | ct.del_flag = '0' |
| | | and ct.supply_attribute = c.supply_attribute |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | and ct.party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | DATE_FORMAT(sign_date, '%Y-%m') AS stat_month, |
| | | SUM(amount) AS total_amount |
| | | FROM contract |
| | | WHERE YEAR(sign_date) = #{queryDTO.year} |
| | | WHERE |
| | | del_flag='0' |
| | | AND YEAR(sign_date) = #{queryDTO.year} |
| | | AND party_b_id = #{compId} |
| | | GROUP BY DATE_FORMAT(sign_date, '%Y-%m') |
| | | ) curr ON m.stat_month = curr.stat_month |
| | |
| | | MONTH(sign_date) AS month_num, |
| | | SUM(amount) AS total_amount |
| | | FROM contract |
| | | WHERE YEAR(sign_date) = YEAR(CURDATE()) |
| | | WHERE del_flag='0' |
| | | AND YEAR(sign_date) = YEAR(CURDATE()) |
| | | AND party_b_id = #{compId} |
| | | GROUP BY DATE_FORMAT(sign_date, '%Y-%m'), MONTH(sign_date) |
| | | ) prev ON m.month_num = prev.month_num + 1 |
| | |
| | | MONTH(sign_date) AS month_num, |
| | | SUM(amount) AS total_amount |
| | | FROM contract |
| | | WHERE YEAR(sign_date) = YEAR(CURDATE()) - 1 |
| | | WHERE del_flag='0' |
| | | AND YEAR(sign_date) = YEAR(CURDATE()) - 1 |
| | | AND party_b_id = #{compId} |
| | | GROUP BY MONTH(sign_date) |
| | | ) last_year ON m.month_num = last_year.month_num |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.sales_model = b.sales_model |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.sales_model = b.sales_model |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.sales_model = b.sales_model |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.sales_model = b.sales_model |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.sales_model = b.sales_model |
| | | AND YEAR( c.sign_date ) = #{queryDTO.year} |
| | | and party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | |
| | | contract c |
| | | JOIN business_customer b ON c.party_a_id = b.id |
| | | WHERE |
| | | b.sales_model IS NOT NULL |
| | | c.del_flag='0' |
| | | AND b.sales_model IS NOT NULL |
| | | AND YEAR ( sign_date ) = #{queryDTO.year} |
| | | GROUP BY |
| | | b.sales_model |
| | |
| | | c.next_schedule_name, |
| | | c.warranty_schedule_id, |
| | | c.comp_id, |
| | | c.center_push_flag, |
| | | (select sum(delivered_quantity*unit_price) from contract_subject_matter csm where csm.contract_id = c.id) outAmount |
| | | FROM |
| | | contract c, |
| | |
| | | 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}, '%') |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND comp_id = 2089995177814495234 |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) smjbr, |
| | | ( |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | AND comp_id = 2089995177814495234 |
| | | 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, |
| | | ( |
| | |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056555602756063234 |
| | | 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' )) smjbn, |
| | | ( |