| | |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseTree; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.label.vo.LabelVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | List<String> getHouseUnit(String districtCode, String building); |
| | | |
| | | @MapKey("id") |
| | | List<Map<String, Object>> labelStatistics(@Param("house") HouseVO house, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | @MapKey("id") |
| | | List<Map<String, Object>> labelCommunityStatistics(@Param("house") HouseVO house, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList); |
| | | |
| | | List<LabelVO> getlabelCount(@Param("house") HouseVO house, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("streetCode") String streetCode); |
| | | } |
| | |
| | | |
| | | |
| | | <select id="labelCommunityStatistics" resultType="java.util.Map"> |
| | | SELECT |
| | | br.code, |
| | | br.name, |
| | | br.id |
| | | FROM |
| | | blade_region br |
| | | <where> |
| | | <if test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | br.code IN |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | and br.parent_code = '361102' |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getlabelCount" resultType="org.springblade.modules.label.vo.LabelVO"> |
| | | |
| | | SELECT |
| | | jc.name, |
| | | (SELECT |
| | | count(DISTINCT jhl.house_code) |
| | | jl.label_name, |
| | | ( SELECT |
| | | count( DISTINCT jhl.house_code ) |
| | | FROM |
| | | jczz_user_house_label jhl |
| | | LEFT JOIN jczz_house jh ON jhl.house_code = jh.house_code |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jh.grid_code |
| | | AND jg.is_deleted = 0 |
| | | LEFT JOIN jczz_community jc ON jc.CODE = jg.community_code |
| | | LEFT JOIN blade_region br ON br.CODE = jg.community_code |
| | | WHERE jhl.lable_type = 2 and jg.community_code = jc.code |
| | | WHERE |
| | | jhl.lable_type = 2 |
| | | AND jl.id = jhl.label_id |
| | | AND jc.street_code = #{streetCode} |
| | | <if test="house.townStreetName!=null and house.townStreetName!=''"> |
| | | and br.town_name like concat('%',#{house.townStreetName},'%') |
| | | </if> |
| | |
| | | AND juhl.label_id IS NOT NULL |
| | | ) |
| | | </if> |
| | | )counts |
| | | ) num |
| | | FROM |
| | | jczz_community jc |
| | | <where> |
| | | <if test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | jc.CODE IN |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | jczz_label jl |
| | | WHERE |
| | | jl.parent_id = '1001' |
| | | ORDER BY |
| | | jl.sort DESC |
| | | |
| | | </select> |
| | | |
| | |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.label.vo.LabelVO; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | |
| | | if (!Strings.isBlank(houseAndHoldExcel.getPartyEmber())) { |
| | | householdEntity.setPartyEmber(Integer.parseInt(houseAndHoldExcel.getPartyEmber())); |
| | | } |
| | | householdEntity.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | householdEntity.setPassport(houseAndHoldExcel.getPassport()); |
| | | // householdEntity.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | // householdEntity.setPassport(houseAndHoldExcel.getPassport()); |
| | | // 民族 |
| | | if (!Strings.isBlank(houseAndHoldExcel.getEthnicity())) { |
| | | householdEntity.setEthnicity(Integer.parseInt(houseAndHoldExcel.getEthnicity())); |
| | |
| | | if (!Strings.isBlank(houseAndHoldExcel.getPartyEmber())) { |
| | | one.setPartyEmber(Integer.parseInt(houseAndHoldExcel.getPartyEmber())); |
| | | } |
| | | one.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | one.setPassport(houseAndHoldExcel.getPassport()); |
| | | // one.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | // one.setPassport(houseAndHoldExcel.getPassport()); |
| | | // 民族 |
| | | if (!Strings.isBlank(houseAndHoldExcel.getEthnicity())) { |
| | | one.setEthnicity(Integer.parseInt(houseAndHoldExcel.getEthnicity())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelStatistics(HouseVO house) { |
| | | public List<Map<String, Object>> labelStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.labelStatistics(house,regionChildCodesList,isAdministrator); |
| | | return baseMapper.labelStatistics(house, regionChildCodesList, isAdministrator); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelCommunityStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.labelCommunityStatistics(house,regionChildCodesList,isAdministrator); |
| | | List<Map<String, Object>> list = baseMapper.labelCommunityStatistics(house, regionChildCodesList); |
| | | for (Map<String, Object> map : list) { |
| | | List<LabelVO> code = baseMapper.getlabelCount(house, regionChildCodesList, isAdministrator, map.get("code").toString()); |
| | | map.put("child",code); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | public class LabelVO extends LabelEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer num; |
| | | } |
| | |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "下拉数据源", notes = "传入tenant") |
| | | @PreAuth("hasAnyRole('administrator', 'admin','wygly','wyxmjl')") |
| | | // @PreAuth("hasAnyRole('administrator', 'admin','wygly','wyxmjl')") |
| | | public R<List<Tenant>> select() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | Tenant tenant = new Tenant(); |
| | |
| | | <result column="has_children" property="hasChildren"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="treeNodeResultMap" type="org.springblade.modules.system.vo.DeptVO"> |
| | | <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode"> |
| | | <id column="id" property="id"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | <result column="title" property="title"/> |
| | | <result column="value" property="value"/> |
| | | <result column="key" property="key"/> |
| | | <result column="has_children" property="hasChildren"/> |
| | | </resultMap> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="tree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | a.id, |
| | | a.dept_name AS title, |
| | | a.parent_id, |
| | | b.id, |
| | | IF |
| | | ( b.id > 0, FALSE, TRUE ) disabled |
| | | FROM |
| | | blade_dept a |
| | | LEFT JOIN ( |
| | | SELECT |
| | | id, |
| | | dept_name AS title, |
| | | parent_id |
| | | FROM |
| | | ( SELECT * FROM blade_dept WHERE is_deleted = 0 AND tenant_id = #{param1} ORDER BY parent_id, id ) org_query, |
| | | ( SELECT @id := #{param2} ) initialisation |
| | | WHERE |
| | | ( FIND_IN_SET( parent_id, @id ) > 0 OR FIND_IN_SET( id, @id ) > 0 ) |
| | | AND @id := CONCAT( @id, ',', id ) |
| | | ORDER BY |
| | | sort |
| | | ) b ON a.id = b.id |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND tenant_id = #{param1} ORDER BY a.sort |
| | | |
| | | <if test="param2!=null"> |
| | | SELECT |
| | | id, |
| | | dept_name AS title, |
| | | id AS "value", |
| | | id AS "key", |
| | | parent_id |
| | | FROM |
| | | ( SELECT * FROM blade_dept WHERE is_deleted = 0 AND tenant_id = #{param1} ORDER BY parent_id, id ) |
| | | org_query, |
| | | ( SELECT @id := #{param2} ) initialisation |
| | | WHERE |
| | | (FIND_IN_SET( parent_id, @id ) > 0 or FIND_IN_SET( id, @id ) > 0) |
| | | AND @id := CONCAT(@id,',',id) ORDER BY sort |
| | | </if> |
| | | |
| | | <if test="param2==null"> |
| | | select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0 |
| | | <if test="param1!=null and param1!=''"> |
| | | and tenant_id = #{param1} |
| | | </if> |
| | | ORDER BY sort |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="lazyTree" resultMap="treeNodeResultMap"> |
| | |
| | | dept.id, |
| | | dept.parent_id, |
| | | dept.dept_name AS title, |
| | | dept.id AS "value", |
| | | dept.id AS "key", |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |