ScDemandMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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.ScDemandMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.ScDemand">
  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:28:31 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="name" jdbcType="VARCHAR" property="name" />
  12. <result column="type" jdbcType="INTEGER" 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="publisher_id" jdbcType="VARCHAR" property="publisherId" />
  17. <result column="reserve_butt_mode" jdbcType="INTEGER" property="reserveButtMode" />
  18. <result column="reserve_butt_unit" jdbcType="VARCHAR" property="reserveButtUnit" />
  19. <result column="reserve_solve_mode" jdbcType="INTEGER" property="reserveSolveMode" />
  20. <result column="investment_cost" jdbcType="VARCHAR" property="investmentCost" />
  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:28:31 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:28:31 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:28:31 CST 2018.
  97. -->
  98. id, name, type, industry, summary, introduce, publisher_id, reserve_butt_mode, reserve_butt_unit,
  99. reserve_solve_mode, investment_cost, create_time, delete_sign
  100. </sql>
  101. <select id="selectByExample" parameterType="com.goafanti.common.model.ScDemandExample" 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:28:31 CST 2018.
  106. -->
  107. select
  108. <if test="distinct">
  109. distinct
  110. </if>
  111. <include refid="Base_Column_List" />
  112. from sc_demand
  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:28:31 CST 2018.
  125. -->
  126. select
  127. <include refid="Base_Column_List" />
  128. from sc_demand
  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:28:31 CST 2018.
  136. -->
  137. delete from sc_demand
  138. where id = #{id,jdbcType=VARCHAR}
  139. </delete>
  140. <delete id="deleteByExample" parameterType="com.goafanti.common.model.ScDemandExample">
  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:28:31 CST 2018.
  145. -->
  146. delete from sc_demand
  147. <if test="_parameter != null">
  148. <include refid="Example_Where_Clause" />
  149. </if>
  150. </delete>
  151. <insert id="insert" parameterType="com.goafanti.common.model.ScDemand">
  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:28:31 CST 2018.
  156. -->
  157. insert into sc_demand (id, name, type,
  158. industry, summary, introduce,
  159. publisher_id, reserve_butt_mode, reserve_butt_unit,
  160. reserve_solve_mode, investment_cost, create_time,
  161. delete_sign)
  162. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  163. #{industry,jdbcType=INTEGER}, #{summary,jdbcType=VARCHAR}, #{introduce,jdbcType=VARCHAR},
  164. #{publisherId,jdbcType=VARCHAR}, #{reserveButtMode,jdbcType=INTEGER}, #{reserveButtUnit,jdbcType=VARCHAR},
  165. #{reserveSolveMode,jdbcType=INTEGER}, #{investmentCost,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  166. #{deleteSign,jdbcType=INTEGER})
  167. </insert>
  168. <insert id="insertSelective" parameterType="com.goafanti.common.model.ScDemand">
  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:28:31 CST 2018.
  173. -->
  174. insert into sc_demand
  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="publisherId != null">
  195. publisher_id,
  196. </if>
  197. <if test="reserveButtMode != null">
  198. reserve_butt_mode,
  199. </if>
  200. <if test="reserveButtUnit != null">
  201. reserve_butt_unit,
  202. </if>
  203. <if test="reserveSolveMode != null">
  204. reserve_solve_mode,
  205. </if>
  206. <if test="investmentCost != null">
  207. investment_cost,
  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=INTEGER},
  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="publisherId != null">
  236. #{publisherId,jdbcType=VARCHAR},
  237. </if>
  238. <if test="reserveButtMode != null">
  239. #{reserveButtMode,jdbcType=INTEGER},
  240. </if>
  241. <if test="reserveButtUnit != null">
  242. #{reserveButtUnit,jdbcType=VARCHAR},
  243. </if>
  244. <if test="reserveSolveMode != null">
  245. #{reserveSolveMode,jdbcType=INTEGER},
  246. </if>
  247. <if test="investmentCost != null">
  248. #{investmentCost,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.ScDemandExample" 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:28:31 CST 2018.
  263. -->
  264. select count(*) from sc_demand
  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:28:31 CST 2018.
  274. -->
  275. update sc_demand
  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=INTEGER},
  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.publisherId != null">
  296. publisher_id = #{record.publisherId,jdbcType=VARCHAR},
  297. </if>
  298. <if test="record.reserveButtMode != null">
  299. reserve_butt_mode = #{record.reserveButtMode,jdbcType=INTEGER},
  300. </if>
  301. <if test="record.reserveButtUnit != null">
  302. reserve_butt_unit = #{record.reserveButtUnit,jdbcType=VARCHAR},
  303. </if>
  304. <if test="record.reserveSolveMode != null">
  305. reserve_solve_mode = #{record.reserveSolveMode,jdbcType=INTEGER},
  306. </if>
  307. <if test="record.investmentCost != null">
  308. investment_cost = #{record.investmentCost,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:28:31 CST 2018.
  326. -->
  327. update sc_demand
  328. set id = #{record.id,jdbcType=VARCHAR},
  329. name = #{record.name,jdbcType=VARCHAR},
  330. type = #{record.type,jdbcType=INTEGER},
  331. industry = #{record.industry,jdbcType=INTEGER},
  332. summary = #{record.summary,jdbcType=VARCHAR},
  333. introduce = #{record.introduce,jdbcType=VARCHAR},
  334. publisher_id = #{record.publisherId,jdbcType=VARCHAR},
  335. reserve_butt_mode = #{record.reserveButtMode,jdbcType=INTEGER},
  336. reserve_butt_unit = #{record.reserveButtUnit,jdbcType=VARCHAR},
  337. reserve_solve_mode = #{record.reserveSolveMode,jdbcType=INTEGER},
  338. investment_cost = #{record.investmentCost,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.ScDemand">
  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:28:31 CST 2018.
  350. -->
  351. update sc_demand
  352. <set>
  353. <if test="name != null">
  354. name = #{name,jdbcType=VARCHAR},
  355. </if>
  356. <if test="type != null">
  357. type = #{type,jdbcType=INTEGER},
  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="publisherId != null">
  369. publisher_id = #{publisherId,jdbcType=VARCHAR},
  370. </if>
  371. <if test="reserveButtMode != null">
  372. reserve_butt_mode = #{reserveButtMode,jdbcType=INTEGER},
  373. </if>
  374. <if test="reserveButtUnit != null">
  375. reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR},
  376. </if>
  377. <if test="reserveSolveMode != null">
  378. reserve_solve_mode = #{reserveSolveMode,jdbcType=INTEGER},
  379. </if>
  380. <if test="investmentCost != null">
  381. investment_cost = #{investmentCost,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.ScDemand">
  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:28:31 CST 2018.
  397. -->
  398. update sc_demand
  399. set name = #{name,jdbcType=VARCHAR},
  400. type = #{type,jdbcType=INTEGER},
  401. industry = #{industry,jdbcType=INTEGER},
  402. summary = #{summary,jdbcType=VARCHAR},
  403. introduce = #{introduce,jdbcType=VARCHAR},
  404. publisher_id = #{publisherId,jdbcType=VARCHAR},
  405. reserve_butt_mode = #{reserveButtMode,jdbcType=INTEGER},
  406. reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR},
  407. reserve_solve_mode = #{reserveSolveMode,jdbcType=INTEGER},
  408. investment_cost = #{investmentCost,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="findDemandListByPage" parameterType="String" resultType="com.goafanti.sc.bo.ScDemandListBo">
  414. select a.id,a.name,a.industry,b.name as orgName,a.reserve_butt_unit as reserveButtUnit,
  415. b.contacts,b.telephone,b.address
  416. from sc_demand a left join sc_publisher b on a.publisher_id=b.id
  417. left join sc_organization c on b.id=c.publisher_id
  418. left join industry_category d on a.industry=d.id
  419. where a.delete_sign=0
  420. <if test="type != null">
  421. and a.`type`= #{type,jdbcType=VARCHAR}
  422. </if>
  423. <if test="name != null">
  424. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  425. </if>
  426. <if test="orgName != null">
  427. and b.name like CONCAT('%',#{orgName,jdbcType=VARCHAR},'%')
  428. </if>
  429. <if test="reserveButtUnit != null">
  430. and a.reserve_butt_unit like CONCAT('%',#{reserveButtUnit,jdbcType=VARCHAR},'%')
  431. </if>
  432. order by a.create_time desc
  433. <if test="page_sql!=null">
  434. ${page_sql}
  435. </if>
  436. </select>
  437. <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
  438. select count(*)
  439. from sc_demand a left join sc_publisher b on a.publisher_id=b.id
  440. where a.delete_sign=0
  441. <if test="type != null">
  442. and a.`type`= #{type,jdbcType=VARCHAR}
  443. </if>
  444. <if test="name != null">
  445. and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  446. </if>
  447. <if test="orgName != null">
  448. and b.name like CONCAT('%',#{orgName,jdbcType=VARCHAR},'%')
  449. </if>
  450. <if test="reserveButtUnit != null">
  451. and a.reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR}
  452. </if>
  453. </select>
  454. <select id="selectById" parameterType="String" resultType="com.goafanti.sc.bo.inputDemands">
  455. select a.id,a.name,a.type,a.introduce,a.summary,a.industry,
  456. a.reserve_butt_mode as reserveButtMode,a.reserve_butt_unit as reserveButtUnit,a.reserve_solve_mode as reserveSolveMode,
  457. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createDateFormat,a.investment_cost as investmentCost,
  458. b.name as pname,b.province,d.name as provinceName,b.city,e.name as cityName,b.email, b.zip_code as zipCode,
  459. b.contacts as publisherName, b.telephone, b.address, b.introduce as Pintroduce, b.remarks,
  460. f.nature,f.website,f.feature,f.legal_person as legalPerson,
  461. f.employee_number as employeeNumber,f.registered_capital as registeredCapital,
  462. f.licence_number as licenceNumber
  463. from sc_demand a left join sc_publisher b on a.publisher_id=b.id
  464. left join industry_category c on a.industry=c.id
  465. left join district_glossory d on b.province=d.id
  466. left join district_glossory e on b.province=e.id
  467. left join sc_organization f on a.publisher_id=f.publisher_id
  468. where a.id= #{id,jdbcType=VARCHAR}
  469. </select>
  470. </mapper>