| | |
| | | |
| | | <select id="qryReport" resultType="com.panzhihua.common.model.dtos.partybuilding.QryReportResp"> |
| | | SELECT |
| | | ctn.id as categoryId, |
| | | sum( IF(npi.id is null,0,1) ) as sum, |
| | | ctn.`name` as categoryName |
| | | ctn.id as categoryId, |
| | | sum( IF(npi.id is null,0,1) ) as sum, |
| | | ctn.`name` as categoryName |
| | | FROM |
| | | com_act_neighbor_circle_topic_new AS ctn |
| | | LEFT JOIN new_fight_need_problem_inventory AS npi ON npi.classify_id = ctn.id |
| | | WHERE npi.creation_time >= concat(#{yearTime},'-01-01 00:00:00') |
| | | AND npi.creation_time <= concat(#{yearTime},'-12-31 59:59:59') |
| | | com_act_neighbor_circle_topic_new AS ctn |
| | | LEFT JOIN ( |
| | | SELECT * from new_fight_need_problem_inventory |
| | | <if test="yearTime != null and yearTime != '' "> |
| | | WHERE |
| | | creation_time >= concat(#{yearTime},'-01-01 00:00:00') |
| | | AND creation_time <= concat(#{yearTime},'-12-31 59:59:59') |
| | | </if> |
| | | ) |
| | | AS npi ON npi.classify_id = ctn.id |
| | | GROUP BY |
| | | ctn.id |
| | | |