ProjectSizeMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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.ProjectSizeMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.ProjectSize">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="create_id" jdbcType="VARCHAR" property="createId" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="pid" jdbcType="VARCHAR" property="pid" />
  15. <result column="pname" jdbcType="VARCHAR" property="pname" />
  16. <result column="price" jdbcType="DECIMAL" property="price" />
  17. <result column="offset" jdbcType="DECIMAL" property="offset" />
  18. <result column="activity_price" jdbcType="DECIMAL" property="activityPrice" />
  19. <result column="activity_flag" jdbcType="VARCHAR" property="activityFlag" />
  20. <result column="member_price" jdbcType="DECIMAL" property="memberPrice" />
  21. <result column="status" jdbcType="INTEGER" property="status" />
  22. </resultMap>
  23. <sql id="Example_Where_Clause">
  24. <!--
  25. WARNING - @mbg.generated
  26. This element is automatically generated by MyBatis Generator, do not modify.
  27. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  28. -->
  29. <where>
  30. <foreach collection="oredCriteria" item="criteria" separator="or">
  31. <if test="criteria.valid">
  32. <trim prefix="(" prefixOverrides="and" suffix=")">
  33. <foreach collection="criteria.criteria" item="criterion">
  34. <choose>
  35. <when test="criterion.noValue">
  36. and ${criterion.condition}
  37. </when>
  38. <when test="criterion.singleValue">
  39. and ${criterion.condition} #{criterion.value}
  40. </when>
  41. <when test="criterion.betweenValue">
  42. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  43. </when>
  44. <when test="criterion.listValue">
  45. and ${criterion.condition}
  46. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  47. #{listItem}
  48. </foreach>
  49. </when>
  50. </choose>
  51. </foreach>
  52. </trim>
  53. </if>
  54. </foreach>
  55. </where>
  56. </sql>
  57. <sql id="Update_By_Example_Where_Clause">
  58. <!--
  59. WARNING - @mbg.generated
  60. This element is automatically generated by MyBatis Generator, do not modify.
  61. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  62. -->
  63. <where>
  64. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  65. <if test="criteria.valid">
  66. <trim prefix="(" prefixOverrides="and" suffix=")">
  67. <foreach collection="criteria.criteria" item="criterion">
  68. <choose>
  69. <when test="criterion.noValue">
  70. and ${criterion.condition}
  71. </when>
  72. <when test="criterion.singleValue">
  73. and ${criterion.condition} #{criterion.value}
  74. </when>
  75. <when test="criterion.betweenValue">
  76. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  77. </when>
  78. <when test="criterion.listValue">
  79. and ${criterion.condition}
  80. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  81. #{listItem}
  82. </foreach>
  83. </when>
  84. </choose>
  85. </foreach>
  86. </trim>
  87. </if>
  88. </foreach>
  89. </where>
  90. </sql>
  91. <sql id="Base_Column_List">
  92. <!--
  93. WARNING - @mbg.generated
  94. This element is automatically generated by MyBatis Generator, do not modify.
  95. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  96. -->
  97. id, create_id, create_time, update_time, pid, pname, price, offset, activity_price,
  98. activity_flag, member_price, status
  99. </sql>
  100. <select id="selectByExample" parameterType="com.goafanti.common.model.ProjectSizeExample" resultMap="BaseResultMap">
  101. <!--
  102. WARNING - @mbg.generated
  103. This element is automatically generated by MyBatis Generator, do not modify.
  104. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  105. -->
  106. select
  107. <if test="distinct">
  108. distinct
  109. </if>
  110. <include refid="Base_Column_List" />
  111. from project_size
  112. <if test="_parameter != null">
  113. <include refid="Example_Where_Clause" />
  114. </if>
  115. <if test="orderByClause != null">
  116. order by ${orderByClause}
  117. </if>
  118. </select>
  119. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  120. <!--
  121. WARNING - @mbg.generated
  122. This element is automatically generated by MyBatis Generator, do not modify.
  123. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  124. -->
  125. select
  126. <include refid="Base_Column_List" />
  127. from project_size
  128. where id = #{id,jdbcType=VARCHAR}
  129. </select>
  130. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  131. <!--
  132. WARNING - @mbg.generated
  133. This element is automatically generated by MyBatis Generator, do not modify.
  134. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  135. -->
  136. delete from project_size
  137. where id = #{id,jdbcType=VARCHAR}
  138. </delete>
  139. <delete id="deleteByExample" parameterType="com.goafanti.common.model.ProjectSizeExample">
  140. <!--
  141. WARNING - @mbg.generated
  142. This element is automatically generated by MyBatis Generator, do not modify.
  143. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  144. -->
  145. delete from project_size
  146. <if test="_parameter != null">
  147. <include refid="Example_Where_Clause" />
  148. </if>
  149. </delete>
  150. <insert id="insert" parameterType="com.goafanti.common.model.ProjectSize">
  151. <!--
  152. WARNING - @mbg.generated
  153. This element is automatically generated by MyBatis Generator, do not modify.
  154. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  155. -->
  156. insert into project_size (id, create_id, create_time,
  157. update_time, pid, pname,
  158. price, offset, activity_price,
  159. activity_flag, member_price, status
  160. )
  161. values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  162. #{updateTime,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR},
  163. #{price,jdbcType=DECIMAL}, #{offset,jdbcType=DECIMAL}, #{activityPrice,jdbcType=DECIMAL},
  164. #{activityFlag,jdbcType=VARCHAR}, #{memberPrice,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}
  165. )
  166. </insert>
  167. <insert id="insertSelective" parameterType="com.goafanti.common.model.ProjectSize">
  168. <!--
  169. WARNING - @mbg.generated
  170. This element is automatically generated by MyBatis Generator, do not modify.
  171. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  172. -->
  173. insert into project_size
  174. <trim prefix="(" suffix=")" suffixOverrides=",">
  175. <if test="id != null">
  176. id,
  177. </if>
  178. <if test="createId != null">
  179. create_id,
  180. </if>
  181. <if test="createTime != null">
  182. create_time,
  183. </if>
  184. <if test="updateTime != null">
  185. update_time,
  186. </if>
  187. <if test="pid != null">
  188. pid,
  189. </if>
  190. <if test="pname != null">
  191. pname,
  192. </if>
  193. <if test="price != null">
  194. price,
  195. </if>
  196. <if test="offset != null">
  197. offset,
  198. </if>
  199. <if test="activityPrice != null">
  200. activity_price,
  201. </if>
  202. <if test="activityFlag != null">
  203. activity_flag,
  204. </if>
  205. <if test="memberPrice != null">
  206. member_price,
  207. </if>
  208. <if test="status != null">
  209. status,
  210. </if>
  211. </trim>
  212. <trim prefix="values (" suffix=")" suffixOverrides=",">
  213. <if test="id != null">
  214. #{id,jdbcType=VARCHAR},
  215. </if>
  216. <if test="createId != null">
  217. #{createId,jdbcType=VARCHAR},
  218. </if>
  219. <if test="createTime != null">
  220. #{createTime,jdbcType=TIMESTAMP},
  221. </if>
  222. <if test="updateTime != null">
  223. #{updateTime,jdbcType=TIMESTAMP},
  224. </if>
  225. <if test="pid != null">
  226. #{pid,jdbcType=VARCHAR},
  227. </if>
  228. <if test="pname != null">
  229. #{pname,jdbcType=VARCHAR},
  230. </if>
  231. <if test="price != null">
  232. #{price,jdbcType=DECIMAL},
  233. </if>
  234. <if test="offset != null">
  235. #{offset,jdbcType=DECIMAL},
  236. </if>
  237. <if test="activityPrice != null">
  238. #{activityPrice,jdbcType=DECIMAL},
  239. </if>
  240. <if test="activityFlag != null">
  241. #{activityFlag,jdbcType=VARCHAR},
  242. </if>
  243. <if test="memberPrice != null">
  244. #{memberPrice,jdbcType=DECIMAL},
  245. </if>
  246. <if test="status != null">
  247. #{status,jdbcType=INTEGER},
  248. </if>
  249. </trim>
  250. </insert>
  251. <select id="countByExample" parameterType="com.goafanti.common.model.ProjectSizeExample" resultType="java.lang.Long">
  252. <!--
  253. WARNING - @mbg.generated
  254. This element is automatically generated by MyBatis Generator, do not modify.
  255. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  256. -->
  257. select count(*) from project_size
  258. <if test="_parameter != null">
  259. <include refid="Example_Where_Clause" />
  260. </if>
  261. </select>
  262. <update id="updateByExampleSelective" parameterType="map">
  263. <!--
  264. WARNING - @mbg.generated
  265. This element is automatically generated by MyBatis Generator, do not modify.
  266. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  267. -->
  268. update project_size
  269. <set>
  270. <if test="record.id != null">
  271. id = #{record.id,jdbcType=VARCHAR},
  272. </if>
  273. <if test="record.createId != null">
  274. create_id = #{record.createId,jdbcType=VARCHAR},
  275. </if>
  276. <if test="record.createTime != null">
  277. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  278. </if>
  279. <if test="record.updateTime != null">
  280. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  281. </if>
  282. <if test="record.pid != null">
  283. pid = #{record.pid,jdbcType=VARCHAR},
  284. </if>
  285. <if test="record.pname != null">
  286. pname = #{record.pname,jdbcType=VARCHAR},
  287. </if>
  288. <if test="record.price != null">
  289. price = #{record.price,jdbcType=DECIMAL},
  290. </if>
  291. <if test="record.offset != null">
  292. offset = #{record.offset,jdbcType=DECIMAL},
  293. </if>
  294. <if test="record.activityPrice != null">
  295. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  296. </if>
  297. <if test="record.activityFlag != null">
  298. activity_flag = #{record.activityFlag,jdbcType=VARCHAR},
  299. </if>
  300. <if test="record.memberPrice != null">
  301. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  302. </if>
  303. <if test="record.status != null">
  304. status = #{record.status,jdbcType=INTEGER},
  305. </if>
  306. </set>
  307. <if test="_parameter != null">
  308. <include refid="Update_By_Example_Where_Clause" />
  309. </if>
  310. </update>
  311. <update id="updateByExample" parameterType="map">
  312. <!--
  313. WARNING - @mbg.generated
  314. This element is automatically generated by MyBatis Generator, do not modify.
  315. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  316. -->
  317. update project_size
  318. set id = #{record.id,jdbcType=VARCHAR},
  319. create_id = #{record.createId,jdbcType=VARCHAR},
  320. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  321. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  322. pid = #{record.pid,jdbcType=VARCHAR},
  323. pname = #{record.pname,jdbcType=VARCHAR},
  324. price = #{record.price,jdbcType=DECIMAL},
  325. offset = #{record.offset,jdbcType=DECIMAL},
  326. activity_price = #{record.activityPrice,jdbcType=DECIMAL},
  327. activity_flag = #{record.activityFlag,jdbcType=VARCHAR},
  328. member_price = #{record.memberPrice,jdbcType=DECIMAL},
  329. status = #{record.status,jdbcType=INTEGER}
  330. <if test="_parameter != null">
  331. <include refid="Update_By_Example_Where_Clause" />
  332. </if>
  333. </update>
  334. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.business.bo.ProjectSizeBo">
  335. <!--
  336. WARNING - @mbg.generated
  337. This element is automatically generated by MyBatis Generator, do not modify.
  338. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  339. -->
  340. update project_size
  341. <set>
  342. <if test="createId != null">
  343. create_id = #{createId,jdbcType=VARCHAR},
  344. </if>
  345. <if test="createTime != null">
  346. create_time = #{createTime,jdbcType=TIMESTAMP},
  347. </if>
  348. <if test="updateTime != null">
  349. update_time = #{updateTime,jdbcType=TIMESTAMP},
  350. </if>
  351. <if test="pid != null">
  352. pid = #{pid,jdbcType=VARCHAR},
  353. </if>
  354. <if test="pname != null">
  355. pname = #{pname,jdbcType=VARCHAR},
  356. </if>
  357. <if test="price != null">
  358. price = #{price,jdbcType=DECIMAL},
  359. </if>
  360. <if test="offset != null">
  361. offset = #{offset,jdbcType=DECIMAL},
  362. </if>
  363. <if test="activityPrice != null">
  364. activity_price = #{activityPrice,jdbcType=DECIMAL},
  365. </if>
  366. <if test="activityFlag != null">
  367. activity_flag = #{activityFlag,jdbcType=VARCHAR},
  368. </if>
  369. <if test="memberPrice != null">
  370. member_price = #{memberPrice,jdbcType=DECIMAL},
  371. </if>
  372. <if test="status != null">
  373. status = #{status,jdbcType=INTEGER},
  374. </if>
  375. </set>
  376. where id = #{id,jdbcType=VARCHAR}
  377. </update>
  378. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ProjectSize">
  379. <!--
  380. WARNING - @mbg.generated
  381. This element is automatically generated by MyBatis Generator, do not modify.
  382. This element was generated on Mon Dec 04 15:29:25 CST 2017.
  383. -->
  384. update project_size
  385. set create_id = #{createId,jdbcType=VARCHAR},
  386. create_time = #{createTime,jdbcType=TIMESTAMP},
  387. update_time = #{updateTime,jdbcType=TIMESTAMP},
  388. pid = #{pid,jdbcType=VARCHAR},
  389. pname = #{pname,jdbcType=VARCHAR},
  390. price = #{price,jdbcType=DECIMAL},
  391. offset = #{offset,jdbcType=DECIMAL},
  392. activity_price = #{activityPrice,jdbcType=DECIMAL},
  393. activity_flag = #{activityFlag,jdbcType=VARCHAR},
  394. member_price = #{memberPrice,jdbcType=DECIMAL},
  395. status = #{status,jdbcType=INTEGER}
  396. where id = #{id,jdbcType=VARCHAR}
  397. </update>
  398. <select id="selectByPrimaryBusinessId" resultType="com.goafanti.business.bo.ProjectSizeBo">
  399. select
  400. p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice,
  401. p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
  402. from project_size p
  403. left join business_project b on p.pid =b.id
  404. where p.pid = #{pid,jdbcType=VARCHAR}
  405. </select>
  406. <select id="selectByBusinessId" parameterType="java.lang.String" resultType="com.goafanti.business.bo.ProjectSizeBo">
  407. select
  408. p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice,
  409. p.activity_flag as activityFlag, p.member_price as memberPrice, p.status,b.bname
  410. from project_size p
  411. left join business_project b on p.pid =b.id
  412. where p.id = #{id,jdbcType=VARCHAR}
  413. </select>
  414. <select id="getgetPnamecount" resultType="com.goafanti.business.bo.ProjectSizeBo">
  415. select
  416. p.id, p.create_id as createId, p.create_time as createTime, p.update_time as updateTime, p.pid, p.pname, p.price, p.offset, p.activity_price as activityPrice,
  417. p.activity_flag as activityFlag, p.member_price as memberPrice, p.status
  418. from project_size p
  419. where p.pname=#{pname,jdbcType=VARCHAR}
  420. </select>
  421. <select id="selectPidList" resultType="string">
  422. select p.pname
  423. from project_size p
  424. where status=0
  425. and pid=#{pid,jdbcType=VARCHAR}
  426. </select>
  427. </mapper>