123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <?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.CzrkJzdzMapper">
-
- <resultMap type="com.boman.domain.CzrkJzdz" id="CzrkJzdzResult">
- <result property="id" column="id" />
- <result property="czrkId" column="czrk_id" />
- <result property="idCard" column="id_card" />
- <result property="userName" column="user_name" />
- <result property="sort" column="sort" />
- <result property="deptId" column="dept_id" />
- <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="townId" column="town_id" />
- <result property="town" column="town" />
- <result property="villageId" column="village_id" />
- <result property="village" column="village" />
- <result property="nowIn" column="now_in" />
- <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="status" column="status" />
- </resultMap>
- <sql id="selectCzrkJzdzVo">
- select id, czrk_id, id_card, user_name, sort, dept_id, province_id, province, city_id, city, region_id, region, town_id, town, village_id, village, now_in, create_by, create_time, update_by, update_time, status from czrk_jzdz
- </sql>
- <select id="selectCzrkJzdzList" resultMap="CzrkJzdzResult">
- <include refid="selectCzrkJzdzVo"/>
- <where>
- <if test="czrkId != null "> and czrk_id = #{czrkId}</if>
- <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
- <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
- <if test="sort != null "> and sort = #{sort}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</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="townId != null and townId != ''"> and town_id = #{townId}</if>
- <if test="town != null and town != ''"> and town = #{town}</if>
- <if test="villageId != null and villageId != ''"> and village_id = #{villageId}</if>
- <if test="village != null and village != ''"> and village = #{village}</if>
- <if test="nowIn != null and nowIn != ''"> and now_in = #{nowIn}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- </where>
- </select>
-
- <select id="selectCzrkJzdzById" parameterType="Long" resultMap="CzrkJzdzResult">
- <include refid="selectCzrkJzdzVo"/>
- where id = #{id}
- </select>
- <select id="listByIdCard" resultMap="CzrkJzdzResult">
- <include refid="selectCzrkJzdzVo"/>
- where id_card in
- <foreach item="idCard" collection="idCardList" open="(" separator="," close=")">
- #{idCard}
- </foreach>
- </select>
- <insert id="insertCzrkJzdz" useGeneratedKeys="true" keyProperty="id">
- insert into czrk_jzdz
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="czrkId != null">czrk_id,</if>
- <if test="idCard != null">id_card,</if>
- <if test="userName != null">user_name,</if>
- <if test="sort != null">sort,</if>
- <if test="deptId != null">dept_id,</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="townId != null">town_id,</if>
- <if test="town != null">town,</if>
- <if test="villageId != null">village_id,</if>
- <if test="village != null">village,</if>
- <if test="nowIn != null">now_in,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="status != null">status,</if>
- create_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="czrkId != null">#{czrkId},</if>
- <if test="idCard != null">#{idCard},</if>
- <if test="userName != null">#{userName},</if>
- <if test="sort != null">#{sort},</if>
- <if test="deptId != null">#{deptId},</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="townId != null">#{townId},</if>
- <if test="town != null">#{town},</if>
- <if test="villageId != null">#{villageId},</if>
- <if test="village != null">#{village},</if>
- <if test="nowIn != null">#{nowIn},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="status != null">#{status},</if>
- sysdate()
- </trim>
- </insert>
- <update id="updateCzrkJzdz" >
- update czrk_jzdz
- <trim prefix="SET" suffixOverrides=",">
- <if test="czrkId != null">czrk_id = #{czrkId},</if>
- <if test="idCard != null">id_card = #{idCard},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="sort != null">sort = #{sort},</if>
- <if test="deptId != null">dept_id = #{deptId},</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="townId != null">town_id = #{townId},</if>
- <if test="town != null">town = #{town},</if>
- <if test="villageId != null">village_id = #{villageId},</if>
- <if test="village != null">village = #{village},</if>
- <if test="nowIn != null">now_in = #{nowIn},</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 = sysdate(),</if>
- <if test="status != null">status = #{status},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateByIdCard" >
- update czrk_jzdz
- <trim prefix="SET" suffixOverrides=",">
- <if test="czrkId != null">czrk_id = #{czrkId},</if>
- <if test="idCard != null">id_card = #{idCard},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="sort != null">sort = #{sort},</if>
- <if test="deptId != null">dept_id = #{deptId},</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="townId != null">town_id = #{townId},</if>
- <if test="town != null">town = #{town},</if>
- <if test="villageId != null">village_id = #{villageId},</if>
- <if test="village != null">village = #{village},</if>
- <if test="nowIn != null">now_in = #{nowIn},</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 = sysdate(),</if>
- <if test="status != null">status = #{status},</if>
- </trim>
- where id_card = #{idCard}
- </update>
- <delete id="deleteCzrkJzdzById" parameterType="Long">
- delete from czrk_jzdz where id = #{id}
- </delete>
- <delete id="deleteByCzrkId" parameterType="Long">
- delete from czrk_jzdz where czrk_id = #{czrkId}
- </delete>
- <delete id="deleteCzrkJzdzByIds" parameterType="String">
- delete from czrk_jzdz where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="listCzrkIdByTypeAreaIdUserName" resultType="java.lang.Long">
- SELECT jzdz.czrk_id
- FROM czrk
- LEFT JOIN czrk_jzdz jzdz ON czrk.id = jzdz.czrk_id
- where czrk.is_del = 'N'
- <if test="userName != null and userName != ''">
- and jzdz.user_name like concat('%', #{userName}, '%')
- </if>
- <choose>
- <when test="type == 1">and jzdz.province_id = #{areaId}</when>
- <when test="type == 2">and jzdz.city_id = #{areaId}</when>
- <when test="type == 3">and jzdz.region_id = #{areaId}</when>
- <when test="type == 4">and jzdz.village_towns_id = #{areaId}</when>
- <when test="type == 5">and jzdz.village_id = #{areaId}</when>
- </choose>
- GROUP BY czrk.id
- </select>
- </mapper>
|