|
@@ -0,0 +1,211 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.boman.web.core.mapper.CzrkMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.boman.domain.Czrk" id="CzrkResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
+ <result property="gender" column="gender" />
|
|
|
+ <result property="age" column="age" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="idCard" column="id_card" />
|
|
|
+ <result property="phoneNum" column="phone_num" />
|
|
|
+ <result property="code" column="code" />
|
|
|
+ <result property="houseType" column="house_type" />
|
|
|
+ <result property="rlr" column="rlr" />
|
|
|
+ <result property="rlTime" column="rl_time" />
|
|
|
+ <result property="yhzgx" column="yhzgx" />
|
|
|
+ <result property="workUnit" column="work_unit" />
|
|
|
+ <result property="provinceId" column="province_id" />
|
|
|
+ <result property="province" column="province" />
|
|
|
+ <result property="cityId" column="city_id" />
|
|
|
+ <result property="city" column="city" />
|
|
|
+ <result property="regionId" column="region_id" />
|
|
|
+ <result property="region" column="region" />
|
|
|
+ <result property="villageTownsId" column="village_towns_id" />
|
|
|
+ <result property="villageTowns" column="village_towns" />
|
|
|
+ <result property="villageId" column="village_id" />
|
|
|
+ <result property="village" column="village" />
|
|
|
+ <result property="villagerGroupId" column="villager_group_id" />
|
|
|
+ <result property="villagerGroup" column="villager_group" />
|
|
|
+ <result property="nowIn" column="now_in" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="isDel" column="is_del" />
|
|
|
+ <result property="deleteReason" column="delete_reason" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <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
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCzrkList" resultMap="CzrkResult">
|
|
|
+ <include refid="selectCzrkVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
+ <if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
|
+ <if test="age != null "> and age = #{age}</if>
|
|
|
+ <if test="birthday != null "> and birthday = #{birthday}</if>
|
|
|
+ <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
|
|
+ <if test="phoneNum != null and phoneNum != ''"> and phone_num = #{phoneNum}</if>
|
|
|
+ <if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
+ <if test="houseType != null and houseType != ''"> and house_type = #{houseType}</if>
|
|
|
+ <if test="rlr != null and rlr != ''"> and rlr = #{rlr}</if>
|
|
|
+ <if test="rlTime != null "> and rl_time = #{rlTime}</if>
|
|
|
+ <if test="yhzgx != null and yhzgx != ''"> and yhzgx = #{yhzgx}</if>
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and work_unit = #{workUnit}</if>
|
|
|
+ <if test="provinceId != null and provinceId != ''"> and province_id = #{provinceId}</if>
|
|
|
+ <if test="province != null and province != ''"> and province = #{province}</if>
|
|
|
+ <if test="cityId != null and cityId != ''"> and city_id = #{cityId}</if>
|
|
|
+ <if test="city != null and city != ''"> and city = #{city}</if>
|
|
|
+ <if test="regionId != null and regionId != ''"> and region_id = #{regionId}</if>
|
|
|
+ <if test="region != null and region != ''"> and region = #{region}</if>
|
|
|
+ <if test="villageTownsId != null and villageTownsId != ''"> and village_towns_id = #{villageTownsId}</if>
|
|
|
+ <if test="villageTowns != null and villageTowns != ''"> and village_towns = #{villageTowns}</if>
|
|
|
+ <if test="villageId != null and villageId != ''"> and village_id = #{villageId}</if>
|
|
|
+ <if test="village != null and village != ''"> and 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 now_in = #{nowIn}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
|
|
+ <if test="deleteReason != null and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCzrkById" parameterType="Long" resultMap="CzrkResult">
|
|
|
+ <include refid="selectCzrkVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCzrk" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into czrk
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="gender != null">gender,</if>
|
|
|
+ <if test="age != null">age,</if>
|
|
|
+ <if test="birthday != null">birthday,</if>
|
|
|
+ <if test="idCard != null">id_card,</if>
|
|
|
+ <if test="phoneNum != null">phone_num,</if>
|
|
|
+ <if test="code != null">code,</if>
|
|
|
+ <if test="houseType != null">house_type,</if>
|
|
|
+ <if test="rlr != null">rlr,</if>
|
|
|
+ <if test="rlTime != null">rl_time,</if>
|
|
|
+ <if test="yhzgx != null">yhzgx,</if>
|
|
|
+ <if test="workUnit != null">work_unit,</if>
|
|
|
+ <if test="provinceId != null">province_id,</if>
|
|
|
+ <if test="province != null">province,</if>
|
|
|
+ <if test="cityId != null">city_id,</if>
|
|
|
+ <if test="city != null">city,</if>
|
|
|
+ <if test="regionId != null">region_id,</if>
|
|
|
+ <if test="region != null">region,</if>
|
|
|
+ <if test="villageTownsId != null">village_towns_id,</if>
|
|
|
+ <if test="villageTowns != null">village_towns,</if>
|
|
|
+ <if test="villageId != null">village_id,</if>
|
|
|
+ <if test="village != null">village,</if>
|
|
|
+ <if test="villagerGroupId != null">villager_group_id,</if>
|
|
|
+ <if test="villagerGroup != null">villager_group,</if>
|
|
|
+ <if test="nowIn != null">now_in,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="isDel != null and isDel != ''">is_del,</if>
|
|
|
+ <if test="deleteReason != null">delete_reason,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="gender != null">#{gender},</if>
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
+ <if test="birthday != null">#{birthday},</if>
|
|
|
+ <if test="idCard != null">#{idCard},</if>
|
|
|
+ <if test="phoneNum != null">#{phoneNum},</if>
|
|
|
+ <if test="code != null">#{code},</if>
|
|
|
+ <if test="houseType != null">#{houseType},</if>
|
|
|
+ <if test="rlr != null">#{rlr},</if>
|
|
|
+ <if test="rlTime != null">#{rlTime},</if>
|
|
|
+ <if test="yhzgx != null">#{yhzgx},</if>
|
|
|
+ <if test="workUnit != null">#{workUnit},</if>
|
|
|
+ <if test="provinceId != null">#{provinceId},</if>
|
|
|
+ <if test="province != null">#{province},</if>
|
|
|
+ <if test="cityId != null">#{cityId},</if>
|
|
|
+ <if test="city != null">#{city},</if>
|
|
|
+ <if test="regionId != null">#{regionId},</if>
|
|
|
+ <if test="region != null">#{region},</if>
|
|
|
+ <if test="villageTownsId != null">#{villageTownsId},</if>
|
|
|
+ <if test="villageTowns != null">#{villageTowns},</if>
|
|
|
+ <if test="villageId != null">#{villageId},</if>
|
|
|
+ <if test="village != null">#{village},</if>
|
|
|
+ <if test="villagerGroupId != null">#{villagerGroupId},</if>
|
|
|
+ <if test="villagerGroup != null">#{villagerGroup},</if>
|
|
|
+ <if test="nowIn != null">#{nowIn},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="isDel != null and isDel != ''">#{isDel},</if>
|
|
|
+ <if test="deleteReason != null">#{deleteReason},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCzrk" >
|
|
|
+ update czrk
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
+ <if test="gender != null">gender = #{gender},</if>
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
+ <if test="birthday != null">birthday = #{birthday},</if>
|
|
|
+ <if test="idCard != null">id_card = #{idCard},</if>
|
|
|
+ <if test="phoneNum != null">phone_num = #{phoneNum},</if>
|
|
|
+ <if test="code != null">code = #{code},</if>
|
|
|
+ <if test="houseType != null">house_type = #{houseType},</if>
|
|
|
+ <if test="rlr != null">rlr = #{rlr},</if>
|
|
|
+ <if test="rlTime != null">rl_time = #{rlTime},</if>
|
|
|
+ <if test="yhzgx != null">yhzgx = #{yhzgx},</if>
|
|
|
+ <if test="workUnit != null">work_unit = #{workUnit},</if>
|
|
|
+ <if test="provinceId != null">province_id = #{provinceId},</if>
|
|
|
+ <if test="province != null">province = #{province},</if>
|
|
|
+ <if test="cityId != null">city_id = #{cityId},</if>
|
|
|
+ <if test="city != null">city = #{city},</if>
|
|
|
+ <if test="regionId != null">region_id = #{regionId},</if>
|
|
|
+ <if test="region != null">region = #{region},</if>
|
|
|
+ <if test="villageTownsId != null">village_towns_id = #{villageTownsId},</if>
|
|
|
+ <if test="villageTowns != null">village_towns = #{villageTowns},</if>
|
|
|
+ <if test="villageId != null">village_id = #{villageId},</if>
|
|
|
+ <if test="village != null">village = #{village},</if>
|
|
|
+ <if test="villagerGroupId != null">villager_group_id = #{villagerGroupId},</if>
|
|
|
+ <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
|
|
|
+ <if test="nowIn != null">now_in = #{nowIn},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
|
|
|
+ <if test="deleteReason != null">delete_reason = #{deleteReason},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCzrkById" parameterType="Long">
|
|
|
+ delete from czrk where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCzrkByIds" parameterType="String">
|
|
|
+ delete from czrk where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|