2024-10-28 营销模块获取农户数据接口,筛选条件增加水卡编号
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/22 11:43 |
| | | * @LastEditTime 2023/12/22 11:43 |
| | | * @Description |
| | | * @Description 农户视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "农户视图对象") |
| | | @JsonPropertyOrder({"countyId","countryName","townId","townName","villageId","villageName","blockId","blockName","divideId","divideName","typeId","waterTypeName","clientId","name","clientNum","phone","idCard","area","cardCount","address","remarks","operateDt"}) |
| | | public class VoClient implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202410282047001L; |
| | | |
| | | |
| | | @Schema(title = "县ID") |
| | | private String countyId; |
| | | @Schema(title = "县名称") |
| | | /** |
| | | * 县ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long countyId; |
| | | |
| | | /** |
| | | * 县名称 |
| | | */ |
| | | private String countryName; |
| | | |
| | | @Schema(title = "镇ID") |
| | | private String townId; |
| | | @Schema(title = "镇名称") |
| | | /** |
| | | * 镇ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long townId; |
| | | |
| | | /** |
| | | * 镇名称 |
| | | */ |
| | | private String townName; |
| | | |
| | | @Schema(title = "村ID") |
| | | private String villageId; |
| | | @Schema(title = "村名称") |
| | | /** |
| | | * 村ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long villageId; |
| | | |
| | | /** |
| | | * 村名称 |
| | | */ |
| | | private String villageName; |
| | | |
| | | @Schema(title = "片区ID") |
| | | private String blockId; |
| | | @Schema(title = "片区名称") |
| | | /** |
| | | * 片区ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long blockId; |
| | | |
| | | /** |
| | | * 片区名称 |
| | | */ |
| | | private String blockName; |
| | | |
| | | @Schema(title = "分水房ID") |
| | | private String divideId; |
| | | @Schema(title = "分水房名称") |
| | | /** |
| | | * 分水房ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long divideId; |
| | | |
| | | /** |
| | | * 分水房名称 |
| | | */ |
| | | private String divideName; |
| | | |
| | | @Schema(title = "用户类型ID") |
| | | private String typeId; |
| | | @Schema(title = "用户类型名称") |
| | | /** |
| | | * 用户类型ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long typeId; |
| | | |
| | | /** |
| | | * 用户类型名称 |
| | | */ |
| | | private String waterTypeName; |
| | | |
| | | @Schema(title = "农户ID") |
| | | private String clientId; |
| | | /** |
| | | * 农户ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long clientId; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | /** |
| | | * 农户姓名 |
| | | */ |
| | | private String name; |
| | | |
| | | @Schema(title = "农户编号") |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "手机号") |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | @Schema(title = "身份证号") |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | private String idCard; |
| | | |
| | | @Schema(title = "种植面积") |
| | | /** |
| | | * 种植面积 |
| | | */ |
| | | private Double area; |
| | | |
| | | @Schema(title = "卡片数量") |
| | | /** |
| | | * 卡片数量 |
| | | */ |
| | | private Integer cardCount; |
| | | |
| | | @Schema(title = "地址") |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | |
| | | @Schema(title = "备注") |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remarks; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_client cli |
| | | , (SELECT @i:=0) AS itable |
| | | LEFT JOIN ba_district dis_con ON cli.countyId = dis_con.id |
| | | LEFT JOIN ba_district dis_town ON cli.townId = dis_town.id |
| | | LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id |
| | | LEFT JOIN ba_block blo ON cli.blockId = blo.id |
| | | LEFT JOIN pr_divide divi ON cli.divideId = divi.id |
| | | LEFT JOIN se_water_type wat ON cli.typeId = wat.id |
| | | LEFT JOIN se_client_card card ON card.clientId = cli.id |
| | | <where> |
| | | AND cli.disabled = 0 |
| | | AND cli.deleted = 0 |
| | |
| | | <if test = "divideId != null and divideId !=''"> |
| | | AND cli.divideId = #{divideId} |
| | | </if> |
| | | <if test = "cardNum != null"> |
| | | AND card.cardNum = #{cardNum} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | |
| | | <!--根据指定条件获取农户数据--> |
| | | <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient"> |
| | | SELECT |
| | | CAST(cli.countyId AS char) AS countyId, |
| | | cli.countyId, |
| | | dis_con.name AS countryName, |
| | | CAST(cli.townId AS char) AS townId, |
| | | cli.townId, |
| | | dis_town.name AS townName, |
| | | CAST(cli.villageId AS char) AS villageId, |
| | | cli.villageId, |
| | | dis_village.name AS villageName, |
| | | CAST(cli.blockId AS char) AS blockId, |
| | | cli.blockId, |
| | | blo.name AS blockName, |
| | | CAST(cli.divideId AS char) AS divideId, |
| | | cli.divideId, |
| | | divi.name AS divideName, |
| | | CAST(cli.typeId AS char) AS typeId, |
| | | cli.typeId, |
| | | wat.typeName AS waterTypeName, |
| | | CAST(cli.id AS char) AS clientId, |
| | | cli.id AS clientId, |
| | | cli.name, |
| | | cli.clientNum, |
| | | cli.phone, |
| | |
| | | LEFT JOIN ba_block blo ON cli.blockId = blo.id |
| | | LEFT JOIN pr_divide divi ON cli.divideId = divi.id |
| | | LEFT JOIN se_water_type wat ON cli.typeId = wat.id |
| | | LEFT JOIN se_client_card card ON card.clientId = cli.id |
| | | <where> |
| | | AND cli.disabled = 0 |
| | | AND cli.deleted = 0 |
| | |
| | | <if test = "divideId != null and divideId !=''"> |
| | | AND cli.divideId = #{divideId} |
| | | </if> |
| | | <if test = "cardNum != null"> |
| | | AND card.cardNum = #{cardNum} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.operateDt DESC |
| | | <trim prefix="limit " > |
| | |
| | | |
| | | @Schema(description = "村ID") |
| | | public String villageId; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | public Long cardNum; |
| | | } |