ScAchievementMapper.xml 18 KB

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