AddressInfo.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.AddressInfoDAO">
  6. <resultMap id="AddressInfoMap" type="com.jpsoft.employment.modules.base.entity.AddressInfo">
  7. <id property="id" column="id_" />
  8. <result property="recipients" column="recipients_" />
  9. <result property="phone" column="phone_" />
  10. <result property="region" column="region_" />
  11. <result property="detailAddress" column="detail_address" />
  12. <result property="regUserId" column="reg_user_id" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="type" column="type_" />
  19. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.AddressInfo">
  21. <!--
  22. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  23. select sys_guid() from dual
  24. </selectKey>
  25. -->
  26. <![CDATA[
  27. insert into base_address_info
  28. (id_,recipients_,phone_,region_,detail_address,reg_user_id,create_by,create_time,update_by,update_time,del_flag,type_)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{recipients,jdbcType=VARCHAR}
  33. ,#{phone,jdbcType=VARCHAR}
  34. ,#{region,jdbcType=VARCHAR}
  35. ,#{detailAddress,jdbcType=VARCHAR}
  36. ,#{regUserId,jdbcType=VARCHAR}
  37. ,#{createBy,jdbcType=VARCHAR}
  38. ,#{createTime,jdbcType= TIMESTAMP }
  39. ,#{updateBy,jdbcType=VARCHAR}
  40. ,#{updateTime,jdbcType= TIMESTAMP }
  41. ,#{delFlag,jdbcType= NUMERIC }
  42. ,#{type,jdbcType=VARCHAR}
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_address_info where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.AddressInfo">
  50. update base_address_info
  51. <set>
  52. <if test="recipients!=null">
  53. recipients_=#{recipients,jdbcType=VARCHAR},
  54. </if>
  55. <if test="phone!=null">
  56. phone_=#{phone,jdbcType=VARCHAR},
  57. </if>
  58. <if test="region!=null">
  59. region_=#{region,jdbcType=VARCHAR},
  60. </if>
  61. <if test="detailAddress!=null">
  62. detail_address=#{detailAddress,jdbcType=VARCHAR},
  63. </if>
  64. <if test="regUserId!=null">
  65. reg_user_id=#{regUserId,jdbcType=VARCHAR},
  66. </if>
  67. <if test="createBy!=null">
  68. create_by=#{createBy,jdbcType=VARCHAR},
  69. </if>
  70. <if test="createTime!=null">
  71. create_time=#{createTime,jdbcType= TIMESTAMP },
  72. </if>
  73. <if test="updateBy!=null">
  74. update_by=#{updateBy,jdbcType=VARCHAR},
  75. </if>
  76. <if test="updateTime!=null">
  77. update_time=#{updateTime,jdbcType= TIMESTAMP },
  78. </if>
  79. <if test="delFlag!=null">
  80. del_flag=#{delFlag,jdbcType= NUMERIC },
  81. </if>
  82. <if test="type!=null">
  83. type_=#{type,jdbcType=VARCHAR},
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="AddressInfoMap">
  89. select * from base_address_info where id_=#{0}
  90. </select>
  91. <select id="getByUser" parameterType="string" resultMap="AddressInfoMap">
  92. select * from base_address_info where reg_user_id=#{0} limit 1
  93. </select>
  94. <select id="exist" parameterType="string" resultType="int">
  95. select count(*) from base_address_info where id_=#{0}
  96. </select>
  97. <select id="list" resultMap="AddressInfoMap">
  98. select * from base_address_info
  99. </select>
  100. <select id="search" parameterType="hashmap" resultMap="AddressInfoMap">
  101. <![CDATA[
  102. select * from base_address_info
  103. ]]>
  104. <where>
  105. del_flag=false
  106. <if test="searchParams.type != null">
  107. and type_ = #{searchParams.type}
  108. </if>
  109. </where>
  110. <foreach item="sort" collection="sortList" open="order by" separator=",">
  111. ${sort.name} ${sort.order}
  112. </foreach>
  113. </select>
  114. </mapper>