OrgTechProductMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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.OrgTechProductMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgTechProduct" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="serial_number" property="serialNumber" jdbcType="VARCHAR" />
  8. <result column="product_name" property="productName" jdbcType="VARCHAR" />
  9. <result column="technical_field1" property="technicalField1" jdbcType="INTEGER" />
  10. <result column="technical_field2" property="technicalField2" jdbcType="INTEGER" />
  11. <result column="technical_field3" property="technicalField3" jdbcType="INTEGER" />
  12. <result column="technical_source" property="technicalSource" jdbcType="INTEGER" />
  13. <result column="last_year_revenue" property="lastYearRevenue" jdbcType="DECIMAL" />
  14. <result column="main_product" property="mainProduct" jdbcType="INTEGER" />
  15. <result column="intellectual_property_number" property="intellectualPropertyNumber" jdbcType="VARCHAR" />
  16. <result column="key_technology" property="keyTechnology" jdbcType="VARCHAR" />
  17. <result column="competitive_edge" property="competitiveEdge" jdbcType="VARCHAR" />
  18. <result column="condition_effect" property="conditionEffect" jdbcType="VARCHAR" />
  19. <result column="year" property="year" jdbcType="INTEGER" />
  20. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  21. <result column="account_url" property="accountUrl" jdbcType="VARCHAR" />
  22. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  23. </resultMap>
  24. <sql id="Base_Column_List" >
  25. id, uid, serial_number, product_name, technical_field1, technical_field2, technical_field3,
  26. technical_source, last_year_revenue, main_product, intellectual_property_number,
  27. key_technology, competitive_edge, condition_effect, year, create_time, account_url, deleted_sign
  28. </sql>
  29. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  30. select
  31. <include refid="Base_Column_List" />
  32. from org_tech_product
  33. where id = #{id,jdbcType=VARCHAR}
  34. </select>
  35. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  36. delete from org_tech_product
  37. where id = #{id,jdbcType=VARCHAR}
  38. </delete>
  39. <insert id="insert" parameterType="com.goafanti.common.model.OrgTechProduct" >
  40. insert into org_tech_product (id, uid, serial_number,
  41. product_name, technical_field1, technical_field2,
  42. technical_field3, technical_source, last_year_revenue,
  43. main_product, intellectual_property_number,
  44. key_technology, competitive_edge, condition_effect,
  45. year, create_time, account_url, deleted_sign)
  46. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR},
  47. #{productName,jdbcType=VARCHAR}, #{technicalField1,jdbcType=INTEGER}, #{technicalField2,jdbcType=INTEGER},
  48. #{technicalField3,jdbcType=INTEGER}, #{technicalSource,jdbcType=INTEGER}, #{lastYearRevenue,jdbcType=DECIMAL},
  49. #{mainProduct,jdbcType=INTEGER}, #{intellectualPropertyNumber,jdbcType=VARCHAR},
  50. #{keyTechnology,jdbcType=VARCHAR}, #{competitiveEdge,jdbcType=VARCHAR}, #{conditionEffect,jdbcType=VARCHAR},
  51. #{year,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{accountUrl,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
  52. </insert>
  53. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgTechProduct" >
  54. insert into org_tech_product
  55. <trim prefix="(" suffix=")" suffixOverrides="," >
  56. <if test="id != null" >
  57. id,
  58. </if>
  59. <if test="uid != null" >
  60. uid,
  61. </if>
  62. <if test="serialNumber != null" >
  63. serial_number,
  64. </if>
  65. <if test="productName != null" >
  66. product_name,
  67. </if>
  68. <if test="technicalField1 != null" >
  69. technical_field1,
  70. </if>
  71. <if test="technicalField2 != null" >
  72. technical_field2,
  73. </if>
  74. <if test="technicalField3 != null" >
  75. technical_field3,
  76. </if>
  77. <if test="technicalSource != null" >
  78. technical_source,
  79. </if>
  80. <if test="lastYearRevenue != null" >
  81. last_year_revenue,
  82. </if>
  83. <if test="mainProduct != null" >
  84. main_product,
  85. </if>
  86. <if test="intellectualPropertyNumber != null" >
  87. intellectual_property_number,
  88. </if>
  89. <if test="keyTechnology != null" >
  90. key_technology,
  91. </if>
  92. <if test="competitiveEdge != null" >
  93. competitive_edge,
  94. </if>
  95. <if test="conditionEffect != null" >
  96. condition_effect,
  97. </if>
  98. <if test="year != null" >
  99. year,
  100. </if>
  101. <if test="createTime != null" >
  102. create_time,
  103. </if>
  104. <if test="accountUrl != null" >
  105. account_url,
  106. </if>
  107. <if test="deletedSign != null" >
  108. deleted_sign,
  109. </if>
  110. </trim>
  111. <trim prefix="values (" suffix=")" suffixOverrides="," >
  112. <if test="id != null" >
  113. #{id,jdbcType=VARCHAR},
  114. </if>
  115. <if test="uid != null" >
  116. #{uid,jdbcType=VARCHAR},
  117. </if>
  118. <if test="serialNumber != null" >
  119. #{serialNumber,jdbcType=VARCHAR},
  120. </if>
  121. <if test="productName != null" >
  122. #{productName,jdbcType=VARCHAR},
  123. </if>
  124. <if test="technicalField1 != null" >
  125. #{technicalField1,jdbcType=INTEGER},
  126. </if>
  127. <if test="technicalField2 != null" >
  128. #{technicalField2,jdbcType=INTEGER},
  129. </if>
  130. <if test="technicalField3 != null" >
  131. #{technicalField3,jdbcType=INTEGER},
  132. </if>
  133. <if test="technicalSource != null" >
  134. #{technicalSource,jdbcType=INTEGER},
  135. </if>
  136. <if test="lastYearRevenue != null" >
  137. #{lastYearRevenue,jdbcType=DECIMAL},
  138. </if>
  139. <if test="mainProduct != null" >
  140. #{mainProduct,jdbcType=INTEGER},
  141. </if>
  142. <if test="intellectualPropertyNumber != null" >
  143. #{intellectualPropertyNumber,jdbcType=VARCHAR},
  144. </if>
  145. <if test="keyTechnology != null" >
  146. #{keyTechnology,jdbcType=VARCHAR},
  147. </if>
  148. <if test="competitiveEdge != null" >
  149. #{competitiveEdge,jdbcType=VARCHAR},
  150. </if>
  151. <if test="conditionEffect != null" >
  152. #{conditionEffect,jdbcType=VARCHAR},
  153. </if>
  154. <if test="year != null" >
  155. #{year,jdbcType=INTEGER},
  156. </if>
  157. <if test="createTime != null" >
  158. #{createTime,jdbcType=TIMESTAMP},
  159. </if>
  160. <if test="accountUrl != null" >
  161. #{accountUrl,jdbcType=VARCHAR},
  162. </if>
  163. <if test="deletedSign != null" >
  164. #{deletedSign,jdbcType=INTEGER},
  165. </if>
  166. </trim>
  167. </insert>
  168. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgTechProduct" >
  169. update org_tech_product
  170. <set >
  171. <if test="uid != null" >
  172. uid = #{uid,jdbcType=VARCHAR},
  173. </if>
  174. <if test="serialNumber != null" >
  175. serial_number = #{serialNumber,jdbcType=VARCHAR},
  176. </if>
  177. <if test="productName != null" >
  178. product_name = #{productName,jdbcType=VARCHAR},
  179. </if>
  180. <if test="technicalField1 != null" >
  181. technical_field1 = #{technicalField1,jdbcType=INTEGER},
  182. </if>
  183. <if test="technicalField2 != null" >
  184. technical_field2 = #{technicalField2,jdbcType=INTEGER},
  185. </if>
  186. <if test="technicalField3 != null" >
  187. technical_field3 = #{technicalField3,jdbcType=INTEGER},
  188. </if>
  189. <if test="technicalSource != null" >
  190. technical_source = #{technicalSource,jdbcType=INTEGER},
  191. </if>
  192. <if test="lastYearRevenue != null" >
  193. last_year_revenue = #{lastYearRevenue,jdbcType=DECIMAL},
  194. </if>
  195. <if test="mainProduct != null" >
  196. main_product = #{mainProduct,jdbcType=INTEGER},
  197. </if>
  198. <if test="intellectualPropertyNumber != null" >
  199. intellectual_property_number = #{intellectualPropertyNumber,jdbcType=VARCHAR},
  200. </if>
  201. <if test="keyTechnology != null" >
  202. key_technology = #{keyTechnology,jdbcType=VARCHAR},
  203. </if>
  204. <if test="competitiveEdge != null" >
  205. competitive_edge = #{competitiveEdge,jdbcType=VARCHAR},
  206. </if>
  207. <if test="conditionEffect != null" >
  208. condition_effect = #{conditionEffect,jdbcType=VARCHAR},
  209. </if>
  210. <if test="year != null" >
  211. year = #{year,jdbcType=INTEGER},
  212. </if>
  213. <if test="createTime != null" >
  214. create_time = #{createTime,jdbcType=TIMESTAMP},
  215. </if>
  216. <if test="accountUrl != null" >
  217. account_url = #{accountUrl,jdbcType=VARCHAR},
  218. </if>
  219. <if test="deletedSign != null" >
  220. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  221. </if>
  222. </set>
  223. where id = #{id,jdbcType=VARCHAR}
  224. </update>
  225. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgTechProduct" >
  226. update org_tech_product
  227. set uid = #{uid,jdbcType=VARCHAR},
  228. serial_number = #{serialNumber,jdbcType=VARCHAR},
  229. product_name = #{productName,jdbcType=VARCHAR},
  230. technical_field1 = #{technicalField1,jdbcType=INTEGER},
  231. technical_field2 = #{technicalField2,jdbcType=INTEGER},
  232. technical_field3 = #{technicalField3,jdbcType=INTEGER},
  233. technical_source = #{technicalSource,jdbcType=INTEGER},
  234. last_year_revenue = #{lastYearRevenue,jdbcType=DECIMAL},
  235. main_product = #{mainProduct,jdbcType=INTEGER},
  236. intellectual_property_number = #{intellectualPropertyNumber,jdbcType=VARCHAR},
  237. key_technology = #{keyTechnology,jdbcType=VARCHAR},
  238. competitive_edge = #{competitiveEdge,jdbcType=VARCHAR},
  239. condition_effect = #{conditionEffect,jdbcType=VARCHAR},
  240. year = #{year,jdbcType=INTEGER},
  241. create_time = #{createTime,jdbcType=TIMESTAMP},
  242. account_url = #{accountUrl,jdbcType=VARCHAR},
  243. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  244. where id = #{id,jdbcType=VARCHAR}
  245. </update>
  246. <select id = "findOrgTechProductListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  247. select
  248. <include refid="Base_Column_List" />
  249. from org_tech_product
  250. where deleted_sign = 0
  251. <if test="uid != null">
  252. and uid = #{uid,jdbcType=VARCHAR}
  253. </if>
  254. <if test="year != null">
  255. and year = #{year,jdbcType=INTEGER}
  256. </if>
  257. order by create_time desc
  258. <if test="page_sql != null">
  259. ${page_sql}
  260. </if>
  261. </select>
  262. <select id="findOrgTechProductCount" resultType="java.lang.Integer" parameterType="String">
  263. select count(1)
  264. from org_tech_product
  265. where deleted_sign = 0
  266. <if test="uid != null">
  267. and uid = #{uid,jdbcType=VARCHAR}
  268. </if>
  269. <if test="year != null">
  270. and year = #{year,jdbcType=INTEGER}
  271. </if>
  272. </select>
  273. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  274. update org_tech_product set deleted_sign = 1
  275. where id in
  276. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  277. #{item}
  278. </foreach>
  279. </update>
  280. <select id="findBySerialNumberAndUid" resultMap="BaseResultMap" >
  281. select
  282. <include refid="Base_Column_List" />
  283. from org_tech_product
  284. where deleted_sign = 0
  285. and serial_number = #{serialNumber,jdbcType=VARCHAR}
  286. and uid = #{uid,jdbcType=VARCHAR}
  287. </select>
  288. </mapper>