123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.FxryMapper">
- <insert id="add">
- INSERT INTO fxry(`id`, `name`, `sex`, `age`, `id_card`, `village_towns_id`, `village_towns`, `village_id`,
- `village`, `group_id`, `group`, `detail_addr`, `id_card_hide`, `addr_outside_province`,
- `intended_return_time`, `telephone`, `remark`, `detail_addr`, `wzhjdz`
- `create_time`, `create_by`, `update_time`, `update_by`)
- VALUES (#{id}, #{name}, #{sex}, #{age}, #{idCard}, #{villageTownsId}, #{villageTowns}, #{villageId},
- #{village}, #{groupId}, #{group}, #{detailAddr}, #{idCardHide}, #{addrOutsideProvince},
- #{intendedReturnTime}, #{telephone}, #{remark}, #{detailAddr}, #{wzhjdz},
- SYSDATE(), #{createBy}, SYSDATE(), #{updateBy});
- </insert>
- <update id="edit">
- UPDATE fxry
- <set>
- <if test="name != null and name != ''">name = #{name},</if>
- <if test="sex != null and sex != ''">sex = #{sex},</if>
- <if test="age != null and age != ''">age = #{age},</if>
- <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
- <if test="villageTownsId != null and villageTownsId != ''">village_towns_id = #{villageTownsId},</if>
- <if test="villageTowns != null and villageTowns != ''">village_towns = #{villageTowns},</if>
- <if test="villageId != null and villageId != ''">village_id = #{villageId},</if>
- <if test="village != null and village != ''">village = #{village},</if>
- <if test="village != null and village != ''">village = #{village},</if>
- <if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
- <if test="group != null and group != ''">`group` = #{group},</if>
- <if test="detailAddr != null and detailAddr != ''">detail_addr = #{detailAddr},</if>
- <if test="wzhjdz != null and wzhjdz != ''">wzhjdz = #{wzhjdz},</if>
- <if test="idCardHide != null and idCardHide != ''">id_card_hide = #{idCardHide},</if>
- <if test="addrOutsideProvince != null and addrOutsideProvince != ''">addr_outside_province = #{addrOutsideProvince},</if>
- <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
- <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
- <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
- <if test="remark != null and remark != ''">remark = #{remark},</if>
- <if test="delete != null and delete != ''">`delete` = #{delete},</if>
- <if test="updateTime != null and updateTime != ''">update_time = SYSDATE()</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- </set>
- WHERE `id` = #{id};
- </update>
- <update id="delete">
- UPDATE fxry
- SET `delete` = '是',
- update_time = SYSDATE(),
- update_by = #{updateBy}
- WHERE `id` = #{id};
- </update>
- <select id="list" resultType="com.boman.domain.Fxry">
- select id,
- `name`,
- telephone,
- id_card_hide idCard,
- wzhjdz,
- addr_outside_province addrOutsideProvince,
- intended_return_time intendedReturnTime
- from fxry
- where `delete` = '否'
- <if test="name != null and name != ''">and `name` like concat('%', #{name}, '%')</if>
- <if test="sex != null and sex != ''">and `sex` like concat('%', #{sex}, '%')</if>
- <if test="idCard != null and idCard != ''">and `id_card` like concat('%', #{idCard}, '%')</if>
- <if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
- order by create_time desc
- </select>
- <select id="getById" resultType="com.boman.domain.Fxry">
- select id,
- `name`,
- detail_addr detailAddr,
- id_card idCard,
- addr_outside_province addrOutsideProvince,
- intended_return_time intendedReturnTime,
- telephone
- from fxry
- where id = #{id} limit 1;
- </select>
- </mapper>
|