OrganizationYearProjectMapper.xml 12 KB

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