<?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.ruoyi.circuit.mapper.CIntegratedCircuitMapper">


<delete id="clearData"    >
	truncate table c_integrated_circuit  
	</delete>
	
<select id="listForLast" resultType="map">
select  count(*) total_cnt,modify_city,modify_city_code from c_integrated_circuit where modify_province ='云南省'  group by modify_city,modify_city_code 

  </select>
  
  
  <select id="sumForLast" resultType="long">
select  count(*) total_cnt from c_integrated_circuit  where modify_province ='云南省' 
  </select>
  
  <select id="listReport" resultType="map">
select <if test="cityCode != null  and cityCode != ''"> modify_county area_name, </if>
<if test="cityCode == null  or cityCode == ''"> modify_city area_name, </if>
pub_year ,count(*) total_cnt from c_integrated_circuit  
where modify_city is not null and modify_city !='' and pub_date is not null and pub_date!=''   and pub_year is not null and pub_year!='' 
	<if test="queryDate != null  and queryDate != ''"> and pub_date <![CDATA[<=]]>#{queryDate} </if>
	<if test="beginDate != null  and beginDate != ''"> and pub_date <![CDATA[>=]]>#{beginDate} </if>
	<if test="endDate != null  and endDate != ''"> and pub_date <![CDATA[<=]]>#{endDate} </if> 
	<if test="cityCode != null  and cityCode != ''"> and modify_city_code = #{cityCode}  </if> and modify_province ='云南省'  group by 
	<if test="cityCode != null  and cityCode != ''"> modify_county </if> <if test="cityCode == null  or cityCode == ''"> modify_city </if>,pub_year 
  </select>

</mapper>