UserInterviewProjectMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.goafanti.common.dao.UserInterviewProjectMapper">
  4. <resultMap type="com.goafanti.common.model.UserInterviewProject" id="UserInterviewProjectMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="uid" column="uid" jdbcType="VARCHAR"/>
  7. <result property="aid" column="aid" jdbcType="VARCHAR"/>
  8. <result property="pid" column="pid" jdbcType="VARCHAR"/>
  9. <result property="prdid" column="prdid" jdbcType="INTEGER"/>
  10. <result property="type" column="type" jdbcType="INTEGER"/>
  11. <result property="status" column="status" jdbcType="INTEGER"/>
  12. <result property="examineStatus" column="examine_status" jdbcType="INTEGER"/>
  13. <result property="examineStatusOther" column="examine_status_other" jdbcType="VARCHAR"/>
  14. <result property="buyStatus" column="buy_status" jdbcType="INTEGER"/>
  15. <result property="buyStatusOther" column="buy_status_other" jdbcType="VARCHAR"/>
  16. </resultMap>
  17. <sql id="UserInterviewProjectAllSql">
  18. id, uid, aid, pid, prdid, type, status, examine_status, examine_status_other, buy_status, buy_status_other
  19. </sql>
  20. <!--查询单个-->
  21. <select id="selectById" resultMap="UserInterviewProjectMap">
  22. select
  23. <include refid="UserInterviewProjectAllSql"/>
  24. from user_interview_project
  25. where id = #{id}
  26. </select>
  27. <!--新增所有列-->
  28. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  29. insert into user_interview_project(uid, aid, pid, prdid, type, status, examine_status, examine_status_other,
  30. buy_status, buy_status_other)
  31. values (#{uid}, #{aid}, #{pid}, #{prdid}, #{type}, #{status}, #{examineStatus}, #{examineStatusOther},
  32. #{buyStatus}, #{buyStatusOther})
  33. </insert>
  34. <insert id="insertBatch">
  35. insert into user_interview_project(uid, aid, pid, prdid, type, status, examine_status, examine_status_other,
  36. buy_status, buy_status_other)
  37. values
  38. <foreach collection="entities" item="entity" separator=",">
  39. (#{entity.uid}, #{entity.aid}, #{entity.pid}, #{entity.prdid}, #{entity.type}, #{entity.status},
  40. #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus}, #{entity.buyStatusOther})
  41. </foreach>
  42. </insert>
  43. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  44. insert into user_interview_project(uid, aid, pid, prdid, type, status, examine_status, examine_status_other,
  45. buy_status, buy_status_other)
  46. values
  47. <foreach collection="entities" item="entity" separator=",">
  48. (#{entity.uid}, #{entity.aid}, #{entity.pid}, #{entity.prdid}, #{entity.type}, #{entity.status},
  49. #{entity.examineStatus}, #{entity.examineStatusOther}, #{entity.buyStatus}, #{entity.buyStatusOther})
  50. </foreach>
  51. on duplicate key update
  52. uid = values(uid),
  53. aid = values(aid),
  54. pid = values(pid),
  55. prdid = values(prdid),
  56. type = values(type),
  57. status = values(status),
  58. examine_status = values(examine_status),
  59. examine_status_other = values(examine_status_other),
  60. buy_status = values(buy_status),
  61. buy_status_other = values(buy_status_other)
  62. </insert>
  63. <!--通过主键修改数据-->
  64. <update id="update">
  65. update user_interview_project
  66. <set>
  67. <if test="uid != null and uid != ''">
  68. uid = #{uid},
  69. </if>
  70. <if test="aid != null and aid != ''">
  71. aid = #{aid},
  72. </if>
  73. <if test="pid != null and pid != ''">
  74. pid = #{pid},
  75. </if>
  76. <if test="prdid != null">
  77. prdid = #{prdid},
  78. </if>
  79. <if test="type != null">
  80. type = #{type},
  81. </if>
  82. <if test="status != null">
  83. status = #{status},
  84. </if>
  85. <if test="examineStatus != null">
  86. examine_status = #{examineStatus},
  87. </if>
  88. <if test="examineStatusOther != null and examineStatusOther != ''">
  89. examine_status_other = #{examineStatusOther},
  90. </if>
  91. <if test="buyStatus != null">
  92. buy_status = #{buyStatus},
  93. </if>
  94. <if test="buyStatusOther != null and buyStatusOther != ''">
  95. buy_status_other = #{buyStatusOther},
  96. </if>
  97. </set>
  98. where id = #{id}
  99. </update>
  100. <resultMap type="com.goafanti.common.model.UserInterviewProjectBo" id="ListMap">
  101. <result property="id" column="id" jdbcType="INTEGER"/>
  102. <result property="uid" column="uid" jdbcType="VARCHAR"/>
  103. <result property="aid" column="aid" jdbcType="VARCHAR"/>
  104. <result property="pid" column="pid" jdbcType="VARCHAR"/>
  105. <result property="type" column="type" jdbcType="INTEGER"/>
  106. <result property="examineStatus" column="examine_status" jdbcType="INTEGER"/>
  107. <result property="examineStatusOther" column="examine_status_other" jdbcType="VARCHAR"/>
  108. <result property="buyStatus" column="buy_status" jdbcType="INTEGER"/>
  109. <result property="buyStatusOther" column="buy_status_other" jdbcType="VARCHAR"/>
  110. <result property="name" column="bname" jdbcType="VARCHAR"/>
  111. </resultMap>
  112. <!--查询指定行数据-->
  113. <select id="findUserInterviewProjectList" resultMap="ListMap">
  114. select
  115. a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,
  116. b.bname name
  117. from user_interview_project a left join business_project b on a.pid=b.id
  118. <where>
  119. <if test="id != null">
  120. and id = #{id}
  121. </if>
  122. <if test="uid != null and uid != ''">
  123. and uid = #{uid}
  124. </if>
  125. <if test="aid != null and aid != ''">
  126. and aid = #{aid}
  127. </if>
  128. <if test="pid != null and pid != ''">
  129. and pid = #{pid}
  130. </if>
  131. <if test="prdid != null">
  132. and prdid = #{prdid}
  133. </if>
  134. <if test="type != null">
  135. and type = #{type}
  136. </if>
  137. <if test="status != null">
  138. and status = #{status}
  139. </if>
  140. <if test="examineStatus != null">
  141. and examine_status = #{examineStatus}
  142. </if>
  143. <if test="examineStatusOther != null and examineStatusOther != ''">
  144. and examine_status_other = #{examineStatusOther}
  145. </if>
  146. <if test="buyStatus != null">
  147. and buy_status = #{buyStatus}
  148. </if>
  149. <if test="buyStatusOther != null and buyStatusOther != ''">
  150. and buy_status_other = #{buyStatusOther}
  151. </if>
  152. </where>
  153. <if test="page_sql != null">
  154. ${page_sql}
  155. </if>
  156. </select>
  157. <!--统计总行数-->
  158. <select id="findUserInterviewProjectCount" resultType="java.lang.Integer">
  159. select count(1)
  160. from user_interview_project
  161. <where>
  162. <if test="id != null">
  163. and id = #{id}
  164. </if>
  165. <if test="uid != null and uid != ''">
  166. and uid = #{uid}
  167. </if>
  168. <if test="aid != null and aid != ''">
  169. and aid = #{aid}
  170. </if>
  171. <if test="pid != null and pid != ''">
  172. and pid = #{pid}
  173. </if>
  174. <if test="prdid != null">
  175. and prdid = #{prdid}
  176. </if>
  177. <if test="type != null">
  178. and type = #{type}
  179. </if>
  180. <if test="status != null">
  181. and status = #{status}
  182. </if>
  183. <if test="examineStatus != null">
  184. and examine_status = #{examineStatus}
  185. </if>
  186. <if test="examineStatusOther != null and examineStatusOther != ''">
  187. and examine_status_other = #{examineStatusOther}
  188. </if>
  189. <if test="buyStatus != null">
  190. and buy_status = #{buyStatus}
  191. </if>
  192. <if test="buyStatusOther != null and buyStatusOther != ''">
  193. and buy_status_other = #{buyStatusOther}
  194. </if>
  195. </where>
  196. </select>
  197. <!--通过主键删除-->
  198. <delete id="deleteById">
  199. delete
  200. from user_interview_project
  201. where id = #{id}
  202. </delete>
  203. <select id="selectByAid" resultMap="ListMap">
  204. select
  205. a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,a.type,
  206. b.bname name
  207. from user_interview_project a left join business_project b on a.pid=b.id
  208. <where>
  209. <if test="aid != null and aid != ''">
  210. and a.aid = #{aid}
  211. </if>
  212. <if test="uid != null and uid != ''">
  213. and a.uid = #{uid}
  214. </if>
  215. </where>
  216. </select>
  217. </mapper>