|
@@ -362,7 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="listByCode" resultMap="CzrkResult">
|
|
|
- select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
|
|
|
+ select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region,vi.village_towns,vi.village,vi.villager_group, vi.now_in
|
|
|
, vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
|
|
|
from czrk vi
|
|
|
<!--把户主放第一位-->
|
|
@@ -518,6 +518,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where id = #{id} limit 1
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="selectCzrkByIds" parameterType="list" resultMap="CzrkResult">
|
|
|
+ <include refid="selectCzrkVo"/>
|
|
|
+ <if test="ids != null and ids.size() > 0">
|
|
|
+ where id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="countIdCard" resultType="int">
|
|
|
select count(vi.id) from czrk vi where vi.is_del = 'N' and id_card = #{idCard}
|
|
|
</select>
|
|
@@ -966,4 +977,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
sysdate()
|
|
|
</trim>
|
|
|
</insert>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectCzrkList" resultMap="CzrkResult">
|
|
|
+ select c.id,c.user_name,c.id_card,z.province_id, z.province, z.city_id, z.city, z.region_id, z.region, z.town_id as village_towns_id, z.town as village_towns, z.village_id, z.village, z.now_in,c.phone_num,c.house_type,c.rlr,c.confirm_info_user,c.confirm_info_user_time
|
|
|
+ from czrk_jzdz z left join czrk c on c.id = z.czrk_id
|
|
|
+ <where>
|
|
|
+ <!-- 已认领 -->
|
|
|
+ <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
|
|
|
+
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ and (c.user_name like concat('%', #{userName}, '%') or c.id_card like concat('%', #{userName}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="params.startAge != null and params.startAge != ''">and c.age >= #{params.startAge}</if>
|
|
|
+ <if test="params.endAge != null and params.endAge != ''">and c.age <= #{params.endAge}</if>
|
|
|
+ <if test="gender != null and gender != ''"> and c.gender = #{gender}</if>
|
|
|
+ <if test="age != null "> and c.age = #{age}</if>
|
|
|
+ <if test="birthday != null "> and c.birthday = #{birthday}</if>
|
|
|
+ <if test="idCard != null and idCard != ''"> and c.id_card = #{idCard}</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and c.phone_num = #{phoneNum}</if>
|
|
|
+ <if test="code != null and code != ''"> and c.code = #{code}</if>
|
|
|
+ <if test="houseType != null and houseType != ''"> and c.house_type = #{houseType}</if>
|
|
|
+ <if test="rlr != null and rlr != ''"> and c.rlr = #{rlr}</if>
|
|
|
+ <if test="rlTime != null "> and c.rl_time = #{rlTime}</if>
|
|
|
+ <if test="yhzgx != null and yhzgx != ''"> and c.yhzgx = #{yhzgx}</if>
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and c.work_unit = #{workUnit}</if>
|
|
|
+ <if test="provinceId != null and provinceId != ''"> and c.province_id = #{provinceId}</if>
|
|
|
+ <if test="province != null and province != ''"> and c.province = #{province}</if>
|
|
|
+ <if test="cityId != null and cityId != ''"> and c.city_id = #{cityId}</if>
|
|
|
+ <if test="city != null and city != ''"> and c.city = #{city}</if>
|
|
|
+ <if test="regionId != null and regionId != ''"> and c.region_id = #{regionId}</if>
|
|
|
+ <if test="region != null and region != ''"> and c.region = #{region}</if>
|
|
|
+ <if test="villageTownsId != null and villageTownsId != ''"> and c.village_towns_id = #{villageTownsId}</if>
|
|
|
+ <if test="villageTowns != null and villageTowns != ''"> and c.village_towns = #{villageTowns}</if>
|
|
|
+ <if test="villageId != null and villageId != ''"> and c.village_id = #{villageId}</if>
|
|
|
+ <if test="village != null and village != ''"> and c.village = #{village}</if>
|
|
|
+ <!-- <if test="villagerGroupId != null and villagerGroupId != ''"> and villager_group_id = #{villagerGroupId}</if>
|
|
|
+ <if test="villagerGroup != null and villagerGroup != ''"> and villager_group = #{villagerGroup}</if>-->
|
|
|
+ <if test="nowIn != null and nowIn != ''"> and c.now_in = #{nowIn}</if>
|
|
|
+ <if test="status != null and status != ''"> and c.status = #{status}</if>
|
|
|
+ <if test="isConfirm != null and isConfirm != ''"> and c.is_confirm = #{isConfirm}</if>
|
|
|
+ <if test="isDel != null and isDel != ''"> and c.is_del = #{isDel}</if>
|
|
|
+ <if test="deleteReason != null and deleteReason != ''"> and c.delete_reason = #{deleteReason}</if>
|
|
|
+ <if test="gridId != null and gridId != ''"> and c.grid_id = #{gridId}</if>
|
|
|
+ <if test="provinceIdXjd != null "> and z.province_id = #{provinceIdXjd}</if>
|
|
|
+ <if test="cityIdXjd != null "> and z.city_id = #{cityIdXjd}</if>
|
|
|
+ <if test="regionIdXjd != null "> and z.region_id = #{regionIdXjd}</if>
|
|
|
+ <if test="villageTownsIdXjd != null "> and z.town_id = #{villageTownsIdXjd}</if>
|
|
|
+ <if test="villageIdXjd != null "> and z.village_id = #{villageIdXjd}</if>
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
+ and c.dept_id in
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
+ #{deptId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="idCardList != null and idCardList.size() > 0">
|
|
|
+ and c.id_card in
|
|
|
+ <foreach item="idCard" collection="idCardList" open="(" separator="," close=")">
|
|
|
+ #{idCard}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by c.create_time DESC
|
|
|
+ </select>
|
|
|
</mapper>
|