WishInfoUserRecord.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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.WishInfoUserRecordDAO">
  6. <resultMap id="WishInfoUserRecordMap" type="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
  7. <id property="id" column="id_" />
  8. <result property="regUserId" column="reg_user_id" />
  9. <result property="wishInfoId" column="wish_info_id" />
  10. <result property="studentAspirationsId" column="student_aspirations_id" />
  11. <result property="isSpot" column="is_spot" />
  12. <result property="status" column="status_" />
  13. <result property="num" column="num_" />
  14. <result property="delFlag" column="del_flag" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="sender" column="sender_" />
  20. <result property="senderAddress" column="sender_address" />
  21. <result property="senderPhone" column="sender_phone" />
  22. <result property="recipients" column="recipients_" />
  23. <result property="recipientsAddress" column="recipients_address" />
  24. <result property="recipientsPhone" column="recipients_phone" />
  25. <result property="completionTime" column="completion_time" />
  26. <result property="deliveryTime" column="delivery_time" />
  27. </resultMap>
  28. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
  29. <!--
  30. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  31. select sys_guid() from dual
  32. </selectKey>
  33. -->
  34. <![CDATA[
  35. insert into base_wish_info_user_record
  36. (id_,reg_user_id,wish_info_id,student_aspirations_id,is_spot,status_,num_,del_flag,create_by,create_time,update_by,update_time,sender_,sender_address,sender_phone,recipients_,recipients_address,recipients_phone,completion_time,delivery_time)
  37. values
  38. (
  39. #{id,jdbcType=VARCHAR}
  40. ,#{regUserId,jdbcType=VARCHAR}
  41. ,#{wishInfoId,jdbcType=VARCHAR}
  42. ,#{studentAspirationsId,jdbcType=VARCHAR}
  43. ,#{isSpot,jdbcType= NUMERIC }
  44. ,#{status,jdbcType=VARCHAR}
  45. ,#{num,jdbcType=VARCHAR}
  46. ,#{delFlag,jdbcType= NUMERIC }
  47. ,#{createBy,jdbcType=VARCHAR}
  48. ,#{createTime,jdbcType= TIMESTAMP }
  49. ,#{updateBy,jdbcType=VARCHAR}
  50. ,#{updateTime,jdbcType= TIMESTAMP }
  51. ,#{sender,jdbcType=VARCHAR}
  52. ,#{senderAddress,jdbcType=VARCHAR}
  53. ,#{senderPhone,jdbcType=VARCHAR}
  54. ,#{recipients,jdbcType=VARCHAR}
  55. ,#{recipientsAddress,jdbcType=VARCHAR}
  56. ,#{recipientsPhone,jdbcType=VARCHAR}
  57. ,#{completionTime,jdbcType= TIMESTAMP }
  58. ,#{deliveryTime,jdbcType= TIMESTAMP }
  59. )
  60. ]]>
  61. </insert>
  62. <delete id="delete" parameterType="string">
  63. delete from base_wish_info_user_record where id_=#{id,jdbcType=VARCHAR}
  64. </delete>
  65. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.WishInfoUserRecord">
  66. update base_wish_info_user_record
  67. <set>
  68. <if test="regUserId!=null">
  69. reg_user_id=#{regUserId,jdbcType=VARCHAR},
  70. </if>
  71. <if test="wishInfoId!=null">
  72. wish_info_id=#{wishInfoId,jdbcType=VARCHAR},
  73. </if>
  74. <if test="studentAspirationsId!=null">
  75. student_aspirations_id=#{studentAspirationsId,jdbcType=VARCHAR},
  76. </if>
  77. <if test="isSpot!=null">
  78. is_spot=#{isSpot,jdbcType= NUMERIC },
  79. </if>
  80. <if test="status!=null">
  81. status_=#{status,jdbcType=VARCHAR},
  82. </if>
  83. <if test="num!=null">
  84. num_=#{num,jdbcType=VARCHAR},
  85. </if>
  86. <if test="delFlag!=null">
  87. del_flag=#{delFlag,jdbcType= NUMERIC },
  88. </if>
  89. <if test="createBy!=null">
  90. create_by=#{createBy,jdbcType=VARCHAR},
  91. </if>
  92. <if test="createTime!=null">
  93. create_time=#{createTime,jdbcType= TIMESTAMP },
  94. </if>
  95. <if test="updateBy!=null">
  96. update_by=#{updateBy,jdbcType=VARCHAR},
  97. </if>
  98. <if test="updateTime!=null">
  99. update_time=#{updateTime,jdbcType= TIMESTAMP },
  100. </if>
  101. <if test="sender!=null">
  102. sender_=#{sender,jdbcType=VARCHAR},
  103. </if>
  104. <if test="senderAddress!=null">
  105. sender_address=#{senderAddress,jdbcType=VARCHAR},
  106. </if>
  107. <if test="senderPhone!=null">
  108. sender_phone=#{senderPhone,jdbcType=VARCHAR},
  109. </if>
  110. <if test="recipients!=null">
  111. recipients_=#{recipients,jdbcType=VARCHAR},
  112. </if>
  113. <if test="recipientsAddress!=null">
  114. recipients_address=#{recipientsAddress,jdbcType=VARCHAR},
  115. </if>
  116. <if test="recipientsPhone!=null">
  117. recipients_phone=#{recipientsPhone,jdbcType=VARCHAR},
  118. </if>
  119. <if test="completionTime!=null">
  120. completion_time=#{completionTime,jdbcType= TIMESTAMP },
  121. </if>
  122. <if test="completionTime==null">
  123. completion_time = null,
  124. </if>
  125. <if test="deliveryTime!=null">
  126. delivery_time=#{deliveryTime,jdbcType= TIMESTAMP },
  127. </if>
  128. </set>
  129. where id_=#{id}
  130. </update>
  131. <select id="get" parameterType="string" resultMap="WishInfoUserRecordMap">
  132. select * from base_wish_info_user_record where id_=#{0}
  133. </select>
  134. <select id="exist" parameterType="string" resultType="int">
  135. select count(*) from base_wish_info_user_record where id_=#{0}
  136. </select>
  137. <select id="getLastSerialNumber" parameterType="string" resultType="string">
  138. SELECT num_ FROM base_wish_info_user_record
  139. WHERE num_ LIKE #{0}
  140. ORDER BY num_ DESC
  141. LIMIT 1
  142. </select>
  143. <select id="countByWish" parameterType="string" resultType="int">
  144. SELECT COUNT(*) FROM base_wish_info_user_record
  145. WHERE del_flag = 0
  146. AND status_= 1
  147. AND wish_info_id = #{0}
  148. </select>
  149. <select id="countByWishAndStatus" parameterType="string" resultType="int">
  150. SELECT COUNT(*) FROM base_wish_info_user_record
  151. WHERE del_flag = 0
  152. AND status_= #{status}
  153. AND wish_info_id = #{wishInfoId}
  154. </select>
  155. <select id="countByUser" parameterType="string" resultType="int">
  156. SELECT COUNT(*) FROM base_wish_info_user_record
  157. WHERE del_flag = 0
  158. AND status_ = 1
  159. <if test="regUserId != null">
  160. AND reg_user_id = #{regUserId}
  161. </if>
  162. </select>
  163. <select id="list" resultMap="WishInfoUserRecordMap">
  164. select * from base_wish_info_user_record
  165. </select>
  166. <select id="search" parameterType="hashmap" resultMap="WishInfoUserRecordMap">
  167. <![CDATA[
  168. select a.* from base_wish_info_user_record a
  169. left join base_wish_info b on a.wish_info_id = b.id_
  170. left join base_reg_user c on a.reg_user_id = c.id_
  171. ]]>
  172. <where>
  173. a.del_flag = 0
  174. <if test="searchParams.wishInfoId != null">
  175. and a.wish_info_id = #{searchParams.wishInfoId}
  176. </if>
  177. <if test="searchParams.createBy != null">
  178. and a.create_by = #{searchParams.createBy}
  179. </if>
  180. <if test="searchParams.status != null">
  181. and a.status_ = #{searchParams.status}
  182. </if>
  183. <if test="searchParams.num != null">
  184. and a.num_ like #{searchParams.num}
  185. </if>
  186. <if test="searchParams.phone != null">
  187. and c.phone_ like #{searchParams.phone}
  188. </if>
  189. <if test="searchParams.category != null">
  190. and b.category_ = #{searchParams.category}
  191. </if>
  192. <if test="searchParams.wishInfoTitle != null">
  193. and b.title_ = #{searchParams.wishInfoTitle}
  194. </if>
  195. </where>
  196. <foreach item="sort" collection="sortList" open="order by" separator=",">
  197. ${sort.name} ${sort.order}
  198. </foreach>
  199. </select>
  200. </mapper>