OrganizationAnnualReportMapper.xml 15 KB

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