|  |  |  | 
|---|
|  |  |  | <if test = "address != null and address !=''"> | 
|---|
|  |  |  | AND cli.address like CONCAT('%',#{address},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test = "villageId != null and villageId !=''"> | 
|---|
|  |  |  | AND cli.villageId =  #{villageId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "blockId != null and blockId !=''"> | 
|---|
|  |  |  | AND cli.blockId =  #{blockId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "divideId != null and divideId !=''"> | 
|---|
|  |  |  | AND cli.divideId =  #{divideId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | 
|---|
|  |  |  | cli.phone, | 
|---|
|  |  |  | cli.idCard, | 
|---|
|  |  |  | cli.area, | 
|---|
|  |  |  | (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id) AS cardCount, | 
|---|
|  |  |  | (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id)+(SELECT COUNT(*) FROM se_virtual_card WHERE client_id = cli.id) AS cardCount, | 
|---|
|  |  |  | cli.address, | 
|---|
|  |  |  | cli.remarks, | 
|---|
|  |  |  | cli.operateDt | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test = "address != null and address !=''"> | 
|---|
|  |  |  | AND cli.address like CONCAT('%',#{address},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test = "villageId != null and villageId !=''"> | 
|---|
|  |  |  | AND cli.villageId =  #{villageId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "blockId != null and blockId !=''"> | 
|---|
|  |  |  | AND cli.blockId =  #{blockId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "divideId != null and divideId !=''"> | 
|---|
|  |  |  | AND cli.divideId =  #{divideId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | ORDER BY cli.operateDt DESC | 
|---|
|  |  |  | <trim prefix="limit " > | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用--> | 
|---|
|  |  |  | <select id="getAreaCodeById" resultType="java.lang.Long"> | 
|---|
|  |  |  | SELECT districtNum FROM se_client WHERE id = ${clientId} | 
|---|
|  |  |  | SELECT districtNum FROM se_client WHERE id = #{clientId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据农户编号获取农户ID--> | 
|---|