FxryMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.boman.web.core.mapper.FxryMapper">
  6. <insert id="add">
  7. INSERT INTO fxry(`id`, `name`, `sex`, `age`, `id_card`, `village_towns_id`, `village_towns`, `village_id`,
  8. `village`, `group_id`, `group`, `detail_addr`, `id_card_hide`, `addr_outside_province`,
  9. `intended_return_time`, `telephone`, `remark`, `detail_addr`, `wzhjdz`
  10. `create_time`, `create_by`, `update_time`, `update_by`)
  11. VALUES (#{id}, #{name}, #{sex}, #{age}, #{idCard}, #{villageTownsId}, #{villageTowns}, #{villageId},
  12. #{village}, #{groupId}, #{group}, #{detailAddr}, #{idCardHide}, #{addrOutsideProvince},
  13. #{intendedReturnTime}, #{telephone}, #{remark}, #{detailAddr}, #{wzhjdz},
  14. SYSDATE(), #{createBy}, SYSDATE(), #{updateBy});
  15. </insert>
  16. <update id="edit">
  17. UPDATE fxry
  18. <set>
  19. <if test="name != null and name != ''">name = #{name},</if>
  20. <if test="sex != null and sex != ''">sex = #{sex},</if>
  21. <if test="age != null and age != ''">age = #{age},</if>
  22. <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
  23. <if test="villageTownsId != null and villageTownsId != ''">village_towns_id = #{villageTownsId},</if>
  24. <if test="villageTowns != null and villageTowns != ''">village_towns = #{villageTowns},</if>
  25. <if test="villageId != null and villageId != ''">village_id = #{villageId},</if>
  26. <if test="village != null and village != ''">village = #{village},</if>
  27. <if test="village != null and village != ''">village = #{village},</if>
  28. <if test="groupId != null and groupId != ''">group_id = #{groupId},</if>
  29. <if test="group != null and group != ''">`group` = #{group},</if>
  30. <if test="detailAddr != null and detailAddr != ''">detail_addr = #{detailAddr},</if>
  31. <if test="wzhjdz != null and wzhjdz != ''">wzhjdz = #{wzhjdz},</if>
  32. <if test="idCardHide != null and idCardHide != ''">id_card_hide = #{idCardHide},</if>
  33. <if test="addrOutsideProvince != null and addrOutsideProvince != ''">addr_outside_province = #{addrOutsideProvince},</if>
  34. <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
  35. <if test="intendedReturnTime != null and intendedReturnTime != ''">intended_return_time = #{intendedReturnTime},</if>
  36. <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
  37. <if test="remark != null and remark != ''">remark = #{remark},</if>
  38. <if test="delete != null and delete != ''">`delete` = #{delete},</if>
  39. <if test="updateTime != null and updateTime != ''">update_time = SYSDATE()</if>
  40. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  41. </set>
  42. WHERE `id` = #{id};
  43. </update>
  44. <update id="delete">
  45. UPDATE fxry
  46. SET `delete` = '是',
  47. update_time = SYSDATE(),
  48. update_by = #{updateBy}
  49. WHERE `id` = #{id};
  50. </update>
  51. <select id="list" resultType="com.boman.domain.Fxry">
  52. select id,
  53. `name`,
  54. telephone,
  55. id_card_hide idCard,
  56. wzhjdz,
  57. addr_outside_province addrOutsideProvince,
  58. intended_return_time intendedReturnTime
  59. from fxry
  60. where `delete` = '否'
  61. <if test="name != null and name != ''">and `name` like concat('%', #{name}, '%')</if>
  62. <if test="sex != null and sex != ''">and `sex` like concat('%', #{sex}, '%')</if>
  63. <if test="idCard != null and idCard != ''">and `id_card` like concat('%', #{idCard}, '%')</if>
  64. <if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
  65. order by create_time desc
  66. </select>
  67. <select id="getById" resultType="com.boman.domain.Fxry">
  68. select id,
  69. `name`,
  70. detail_addr detailAddr,
  71. id_card idCard,
  72. addr_outside_province addrOutsideProvince,
  73. intended_return_time intendedReturnTime,
  74. telephone
  75. from fxry
  76. where id = #{id} limit 1;
  77. </select>
  78. </mapper>