|
@@ -42,13 +42,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCzrkVo">
|
|
<sql id="selectCzrkVo">
|
|
- select id, user_name, gender, age, birthday, id_card, phone_num, code, house_type, rlr, rl_time, yhzgx, work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns, village_id, village, villager_group_id, villager_group, now_in, remark, status, create_by, create_time, update_by, update_time, is_del, delete_reason from czrk
|
|
|
|
|
|
+ select id, user_name, gender, age, birthday, id_card, phone_num, code, house_type, rlr, rl_time, yhzgx
|
|
|
|
+ , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns
|
|
|
|
+ , village_id, village, villager_group_id, villager_group, now_in, remark, status, create_by, create_time
|
|
|
|
+ , update_by, update_time, is_del, delete_reason, dept_id, is_rl from czrk
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <select id="selectCzrkList" resultMap="CzrkResult">
|
|
|
|
- <include refid="selectCzrkVo"/>
|
|
|
|
- <where>
|
|
|
|
- <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
|
+ <select id="listByRlry" resultMap="CzrkResult">
|
|
|
|
+ select id, user_name, phone_num, id_card, gender, province, city, region
|
|
|
|
+ , house_type, update_by, code, rlr, update_time, delete_reason, now_in
|
|
|
|
+ from czrk
|
|
|
|
+ <where>
|
|
|
|
+ <!-- 已认领 -->
|
|
|
|
+ <if test="isRl != null and isRl != ''">and is_rl = #{isRl}</if>
|
|
|
|
+
|
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
|
+ and (user_name like concat('%', #{userName}, '%') or id_card like concat('%', #{userName}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="params.startAge != null and params.startAge != ''">and age >= #{params.startAge}</if>
|
|
|
|
+ <if test="params.endAge != null and params.endAge != ''">and age <= #{params.endAge}</if>
|
|
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
<if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
<if test="age != null "> and age = #{age}</if>
|
|
<if test="age != null "> and age = #{age}</if>
|
|
<if test="birthday != null "> and birthday = #{birthday}</if>
|
|
<if test="birthday != null "> and birthday = #{birthday}</if>
|
|
@@ -76,9 +88,159 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
|
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
|
<if test="deleteReason != null and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
|
|
<if test="deleteReason != null and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
|
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
|
+ and vi.dept_id in
|
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
+ #{deptId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
|
|
+ order by create_time DESC
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ <select id="listByXz" resultMap="CzrkResult">
|
|
|
|
+ select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
|
|
|
|
+ , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
|
|
|
|
+ from czrk vi
|
|
|
|
+ where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
|
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
|
+ and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="villageTowns != null and villageTowns != ''">
|
|
|
|
+ and vi.village_towns = #{villageTowns}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="village != null and village != ''"> and vi.village = #{village}</if>
|
|
|
|
+ <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
|
|
|
|
+ <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
|
|
|
|
+ <if test="province != null and province != ''"> and vi.province = #{province}</if>
|
|
|
|
+ <if test="city != null and city != ''"> and vi.city = #{city}</if>
|
|
|
|
+ <if test="region != null and region != ''"> and vi.region = #{region}</if>
|
|
|
|
+ <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
|
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
|
|
|
|
+ <if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
|
|
|
|
+ <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and vi.status = #{status}</if>
|
|
|
|
+ <if test="code != null and code != ''"> and vi.code = #{code}</if>
|
|
|
|
+ <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
|
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
|
+ and vi.dept_id in
|
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
+ #{deptId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="countByXz" resultType="int">
|
|
|
|
+ select count(1)
|
|
|
|
+ from czrk vi
|
|
|
|
+ where vi.is_del = 'N' and vi.create_time >= #{startTime} and vi.create_time <= #{endTime}
|
|
|
|
+ <if test="villageTowns != null and villageTowns != ''">
|
|
|
|
+ and vi.village_towns = #{villageTowns}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="village != null and village != ''"> and vi.village = #{village}</if>
|
|
|
|
+ <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
|
|
|
|
+ <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
|
|
|
|
+ <if test="province != null and province != ''"> and vi.province = #{province}</if>
|
|
|
|
+ <if test="city != null and city != ''"> and vi.city = #{city}</if>
|
|
|
|
+ <if test="region != null and region != ''"> and vi.region = #{region}</if>
|
|
|
|
+ <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
+ <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
|
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
|
|
|
|
+ <if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
|
|
|
|
+ <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and vi.status = #{status}</if>
|
|
|
|
+ <if test="code != null and code != ''"> and vi.code = #{code}</if>
|
|
|
|
+ <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
|
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
|
+ and vi.dept_id in
|
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
+ #{deptId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="listByJs" resultMap="CzrkResult">
|
|
|
|
+ select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
|
|
|
|
+ , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
|
|
|
|
+ from czrk vi
|
|
|
|
+ where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
|
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
|
+ and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="villageTowns != null and villageTowns != ''">
|
|
|
|
+ and vi.village_towns = #{villageTowns}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="village != null and village != ''"> and vi.village = #{village}</if>
|
|
|
|
+ <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
|
|
|
|
+ <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
|
|
|
|
+ <if test="province != null and province != ''"> and vi.province = #{province}</if>
|
|
|
|
+ <if test="city != null and city != ''"> and vi.city = #{city}</if>
|
|
|
|
+ <if test="region != null and region != ''"> and vi.region = #{region}</if>
|
|
|
|
+ <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
+ <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
|
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
|
|
|
|
+ <if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
|
|
|
|
+ <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and vi.status = #{status}</if>
|
|
|
|
+ <if test="code != null and code != ''"> and vi.code = #{code}</if>
|
|
|
|
+ <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
|
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
|
+ and vi.dept_id in
|
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
+ #{deptId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="countByJs" resultType="int">
|
|
|
|
+ select count(1)
|
|
|
|
+ from vaccine_info vi
|
|
|
|
+ where vi.is_del = 'Y' and vi.update_time >= #{startTime} and vi.update_time <= #{endTime}
|
|
|
|
+ <if test="villageTowns != null and villageTowns != ''">
|
|
|
|
+ and vi.village_towns = #{villageTowns}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="village != null and village != ''"> and vi.village = #{village}</if>
|
|
|
|
+ <if test="villagerGroup != null and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
|
|
|
|
+ <if test="houseType != null and houseType != ''"> and vi.house_type = #{houseType}</if>
|
|
|
|
+ <if test="province != null and province != ''"> and vi.province = #{province}</if>
|
|
|
|
+ <if test="city != null and city != ''"> and vi.city = #{city}</if>
|
|
|
|
+ <if test="region != null and region != ''"> and vi.region = #{region}</if>
|
|
|
|
+ <if test="userName != null and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
+ <if test="gender != null and gender != ''"> and vi.gender = #{gender}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
|
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
|
|
|
|
+ <if test="params.startAge != null and params.startAge != ''"> and vi.age >= #{params.startAge}</if>
|
|
|
|
+ <if test="params.endAge != null and params.endAge != ''"> and vi.age <= #{params.endAge}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and vi.status = #{status}</if>
|
|
|
|
+ <if test="code != null and code != ''"> and vi.code = #{code}</if>
|
|
|
|
+ <if test="birthday != null and birthday != ''"> and vi.birthday = #{birthday}</if>
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="nowIn != null and nowIn != ''"> and vi.now_in = #{nowIn}</if>
|
|
|
|
+ <if test="deptIdList != null and deptIdList.size() > 0">
|
|
|
|
+ and vi.dept_id in
|
|
|
|
+ <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
+ #{deptId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </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
|
|
|
|
+ , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
|
|
|
|
+ from czrk vi
|
|
|
|
+ <!--把户主放第一位-->
|
|
|
|
+ where vi.is_del = 'N' and code = #{code} order by house_type desc;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="selectCzrkById" parameterType="Long" resultMap="CzrkResult">
|
|
<select id="selectCzrkById" parameterType="Long" resultMap="CzrkResult">
|
|
<include refid="selectCzrkVo"/>
|
|
<include refid="selectCzrkVo"/>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
@@ -202,10 +364,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
delete from czrk where id = #{id}
|
|
delete from czrk where id = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteCzrkByIds" parameterType="String">
|
|
|
|
- delete from czrk where id in
|
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- </delete>
|
|
|
|
|
|
+ <update id="reduction">
|
|
|
|
+ update czrk
|
|
|
|
+ set is_del = 'N'
|
|
|
|
+ , update_by = #{updateBy}
|
|
|
|
+ , update_time = sysdate()
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+<!-- <delete id="deleteCzrk" parameterType="String">-->
|
|
|
|
+<!-- delete from czrk where id in -->
|
|
|
|
+<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
|
|
|
|
+<!-- #{id}-->
|
|
|
|
+<!-- </foreach>-->
|
|
|
|
+<!-- </delete>-->
|
|
|
|
+
|
|
|
|
+ <update id="deleteCzrk">
|
|
|
|
+ update czrk
|
|
|
|
+ set is_del = 'Y'
|
|
|
|
+ , delete_reason = #{deleteReason}
|
|
|
|
+ , update_by = #{updateBy}
|
|
|
|
+ , update_time = sysdate()
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
</mapper>
|
|
</mapper>
|