AboutUs.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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.AboutUsDAO">
  6. <resultMap id="AboutUsMap" type="com.jpsoft.employment.modules.base.entity.AboutUs">
  7. <id property="id" column="id_" />
  8. <result property="userAgreement" column="user_agreement" />
  9. <result property="privacyPolicy" column="privacy_policy" />
  10. <result property="disclaimer" column="disclaimer" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="delFlag" column="del_flag" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="receivingAccount" column="receiving_account" />
  17. <result property="bank" column="bank_" />
  18. <result property="accountNumber" column="account_number" />
  19. <result property="paymentCode" column="payment_code" />
  20. <result property="phone" column="phone_" />
  21. <result property="code" column="code_" />
  22. <result property="content" column="content_" />
  23. <result property="type" column="type_" />
  24. <result property="title" column="title_" />
  25. <result property="contentType" column="content_type" />
  26. </resultMap>
  27. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
  28. <!--
  29. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  30. select sys_guid() from dual
  31. </selectKey>
  32. -->
  33. <![CDATA[
  34. insert into base_about_us
  35. (id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by
  36. ,receiving_account,bank_,account_number,payment_code,phone_,code_,content_,type_,title_,content_type)
  37. values
  38. (
  39. #{id,jdbcType=VARCHAR}
  40. ,#{userAgreement,jdbcType=VARCHAR}
  41. ,#{privacyPolicy,jdbcType=VARCHAR}
  42. ,#{disclaimer,jdbcType=VARCHAR}
  43. ,#{createTime,jdbcType= TIMESTAMP }
  44. ,#{updateTime,jdbcType= TIMESTAMP }
  45. ,#{delFlag,jdbcType= NUMERIC }
  46. ,#{createBy,jdbcType=VARCHAR}
  47. ,#{updateBy,jdbcType=VARCHAR}
  48. ,#{receivingAccount,jdbcType=VARCHAR}
  49. ,#{bank,jdbcType=VARCHAR}
  50. ,#{accountNumber,jdbcType=VARCHAR}
  51. ,#{paymentCode,jdbcType=VARCHAR}
  52. ,#{phone,jdbcType=VARCHAR}
  53. ,#{code,jdbcType=VARCHAR}
  54. ,#{content,jdbcType=VARCHAR}
  55. ,#{type,jdbcType=VARCHAR}
  56. ,#{title,jdbcType=VARCHAR}
  57. ,#{contentType,jdbcType=VARCHAR}
  58. )
  59. ]]>
  60. </insert>
  61. <delete id="delete" parameterType="string">
  62. delete from base_about_us where id_=#{id,jdbcType=VARCHAR}
  63. </delete>
  64. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
  65. update base_about_us
  66. <set>
  67. <if test="userAgreement!=null">
  68. user_agreement=#{userAgreement,jdbcType=VARCHAR},
  69. </if>
  70. <if test="privacyPolicy!=null">
  71. privacy_policy=#{privacyPolicy,jdbcType=VARCHAR},
  72. </if>
  73. <if test="disclaimer!=null">
  74. disclaimer=#{disclaimer,jdbcType=VARCHAR},
  75. </if>
  76. <if test="createTime!=null">
  77. create_time=#{createTime,jdbcType= TIMESTAMP },
  78. </if>
  79. <if test="updateTime!=null">
  80. update_time=#{updateTime,jdbcType= TIMESTAMP },
  81. </if>
  82. <if test="delFlag!=null">
  83. del_flag=#{delFlag,jdbcType= NUMERIC },
  84. </if>
  85. <if test="createBy!=null">
  86. create_by=#{createBy,jdbcType=VARCHAR},
  87. </if>
  88. <if test="updateBy!=null">
  89. update_by=#{updateBy,jdbcType=VARCHAR},
  90. </if>
  91. <if test="receivingAccount!=null">
  92. receiving_account=#{receivingAccount,jdbcType=VARCHAR},
  93. </if>
  94. <if test="bank!=null">
  95. bank_=#{bank,jdbcType=VARCHAR},
  96. </if>
  97. <if test="accountNumber!=null">
  98. account_number=#{accountNumber,jdbcType=VARCHAR},
  99. </if>
  100. <if test="paymentCode!=null">
  101. payment_code=#{paymentCode,jdbcType=VARCHAR},
  102. </if>
  103. <if test="phone!=null">
  104. phone_=#{phone,jdbcType=VARCHAR},
  105. </if>
  106. <if test="code!=null">
  107. code_=#{code,jdbcType=VARCHAR},
  108. </if>
  109. <if test="content!=null">
  110. content_=#{content,jdbcType=VARCHAR},
  111. </if>
  112. <if test="type!=null">
  113. type_=#{type,jdbcType=VARCHAR},
  114. </if>
  115. <if test="title!=null">
  116. title_=#{title,jdbcType=VARCHAR},
  117. </if>
  118. <if test="contentType!=null">
  119. content_type=#{contentType,jdbcType=VARCHAR},
  120. </if>
  121. </set>
  122. where id_=#{id}
  123. </update>
  124. <select id="get" parameterType="string" resultMap="AboutUsMap">
  125. select * from base_about_us where id_=#{0}
  126. </select>
  127. <select id="exist" parameterType="string" resultType="int">
  128. select count(*) from base_about_us where id_=#{0}
  129. </select>
  130. <select id="list" resultMap="AboutUsMap">
  131. select * from base_about_us where del_flag=false limit 1
  132. </select>
  133. <select id="findBySearchParams" resultMap="AboutUsMap">
  134. select * from base_about_us
  135. <where>
  136. del_flag=false
  137. <if test="searchParams.code != null">
  138. and code_ = #{searchParams.code}
  139. </if>
  140. <if test="searchParams.type != null">
  141. and type_ = #{searchParams.type}
  142. </if>
  143. </where>
  144. </select>
  145. <select id="search" parameterType="hashmap" resultMap="AboutUsMap">
  146. <![CDATA[
  147. select * from base_about_us
  148. ]]>
  149. <where>
  150. del_flag=false
  151. <if test="searchParams.id != null">
  152. and ID_ like #{searchParams.id}
  153. </if>
  154. </where>
  155. <foreach item="sort" collection="sortList" open="order by" separator=",">
  156. ${sort.name} ${sort.order}
  157. </foreach>
  158. </select>
  159. </mapper>