| | |
| | | jg.grid_name |
| | | FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_house jhs ON jh.house_code = jhs.house_code |
| | | LEFT JOIN jczz_house jhs ON jh.house_code = jhs.house_code and jhs.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_grid_range jgr on jgr.house_code=jda.address_code |
| | | LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm on jgm.grid_id=jg.id |
| | | WHERE |
| | | jh.is_deleted = 0 |
| | | <if test="household.userId!=null"> |
| | | and jgm.user_id = #{household.userId} |
| | | </if> |
| | | <if test="household.name!=null and household.name !=''"> |
| | | and jh.name like concat('%',#{household.name},'%') |
| | | </if> |
| | |
| | | |
| | | <select id="statistics" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count(1) |
| | | count( 1 ) |
| | | FROM |
| | | jczz_grid_range jgr |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | <where> |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jda.nei_code = #{neiCode} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND jh.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm on jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_household jh on jh.house_code=jgr.house_code |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | and jh.confirm_flag = 0 |
| | | AND jgm.user_id = #{userId} |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} ) |
| | | </if> |
| | | and jh.is_deleted = 0 |
| | | and jh.confirm_flag = 0 |
| | | </where> |
| | | </select> |
| | | |
| | | <!--查询物业--> |