PlanManageMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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.huaxu.task.dao.PlanManageMapper" >
  4. <resultMap id="BaseResultMap" type="com.huaxu.task.entity.PlanManage" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="plan_id" property="planId" jdbcType="VARCHAR" />
  7. <result column="plan_name" property="planName" jdbcType="VARCHAR" />
  8. <result column="plan_user_id" property="planUserId" jdbcType="VARCHAR" />
  9. <result column="user_id" property="userId" jdbcType="VARCHAR" />
  10. <result column="plan_date" property="planDate" jdbcType="TIMESTAMP" />
  11. <result column="plan_start_date" property="planStartDate" jdbcType="TIMESTAMP" />
  12. <result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
  13. <result column="task_content" property="taskContent" jdbcType="VARCHAR" />
  14. <result column="task_area_shape" property="taskAreaShape" jdbcType="VARCHAR" />
  15. <result column="task_area_name" property="taskAreaName" jdbcType="VARCHAR" />
  16. <result column="task_type" property="taskType" jdbcType="INTEGER" />
  17. <result column="plan_status" property="planStatus" jdbcType="INTEGER" />
  18. <result column="tenant_id" property="tenantId" jdbcType="VARCHAR" />
  19. <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
  20. <result column="process_def_id" property="processDefId" jdbcType="VARCHAR" />
  21. <result column="current_task_id" property="currentTaskId" jdbcType="VARCHAR" />
  22. <result column="current_users" property="currentUsers" jdbcType="VARCHAR" />
  23. <result column="current_task_name" property="currentTaskName" jdbcType="VARCHAR" />
  24. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
  25. <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP" />
  26. <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
  27. <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
  28. <!-- <association property="planUser" javaType="com.huaxu.entity.UserEntity">-->
  29. <!-- <id column="plan_user_id" property="id" jdbcType="INTEGER"/>-->
  30. <!-- <result column="plan_user_name" property="username"/>-->
  31. <!-- </association>-->
  32. <!-- <association property="user" javaType="com.huaxu.entity.UserEntity">-->
  33. <!-- <id column="user_id" property="id" jdbcType="INTEGER"/>-->
  34. <!-- <result column="user_name" property="username"/>-->
  35. <!-- </association>-->
  36. <!-- <association property="createBy" javaType="com.huaxu.entity.UserEntity">-->
  37. <!-- <id column="create_by_id" property="id" jdbcType="INTEGER"/>-->
  38. <!-- <result column="create_by_name" property="username"/>-->
  39. <!-- </association>-->
  40. <!-- <association property="updateBy" javaType="com.huaxu.entity.UserEntity">-->
  41. <!-- <id column="update_by_id" property="id" jdbcType="INTEGER"/>-->
  42. <!-- <result column="update_by_name" property="username"/>-->
  43. <!-- </association>-->
  44. </resultMap>
  45. <sql id="Base_Column_List" >
  46. id, plan_id, plan_name, plan_user_id, user_id, plan_date, plan_start_date, plan_end_date,
  47. task_content, task_area_shape, task_area_name, task_type, plan_status, tenant_id,
  48. process_instance_id, process_def_id, current_task_id, current_users, current_task_name,
  49. create_by, date_create, update_by, date_update
  50. </sql>
  51. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  52. select
  53. <include refid="Base_Column_List" />
  54. from sc_plan_manage
  55. where id = #{id,jdbcType=INTEGER}
  56. </select>
  57. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  58. delete from sc_plan_manage
  59. where id = #{id,jdbcType=INTEGER}
  60. </delete>
  61. <insert id="insertSelective" parameterType="com.huaxu.task.entity.PlanManage" >
  62. insert into sc_plan_manage
  63. <trim prefix="(" suffix=")" suffixOverrides="," >
  64. <if test="id != null" >
  65. id,
  66. </if>
  67. <if test="planId != null" >
  68. plan_id,
  69. </if>
  70. <if test="planName != null" >
  71. plan_name,
  72. </if>
  73. <if test="planUserId != null" >
  74. plan_user_id,
  75. </if>
  76. <if test="userId != null" >
  77. user_id,
  78. </if>
  79. <if test="planDate != null" >
  80. plan_date,
  81. </if>
  82. <if test="planStartDate != null" >
  83. plan_start_date,
  84. </if>
  85. <if test="planEndDate != null" >
  86. plan_end_date,
  87. </if>
  88. <if test="taskContent != null" >
  89. task_content,
  90. </if>
  91. <if test="taskAreaShape != null" >
  92. task_area_shape,
  93. </if>
  94. <if test="taskAreaName != null" >
  95. task_area_name,
  96. </if>
  97. <if test="taskType != null" >
  98. task_type,
  99. </if>
  100. <if test="planStatus != null" >
  101. plan_status,
  102. </if>
  103. <if test="tenantId != null" >
  104. tenant_id,
  105. </if>
  106. <if test="processInstanceId != null" >
  107. process_instance_id,
  108. </if>
  109. <if test="processDefId != null" >
  110. process_def_id,
  111. </if>
  112. <if test="currentTaskId != null" >
  113. current_task_id,
  114. </if>
  115. <if test="currentUsers != null" >
  116. current_users,
  117. </if>
  118. <if test="currentTaskName != null" >
  119. current_task_name,
  120. </if>
  121. <if test="createBy != null" >
  122. create_by,
  123. </if>
  124. <if test="dateCreate != null" >
  125. date_create,
  126. </if>
  127. <if test="updateBy != null" >
  128. update_by,
  129. </if>
  130. <if test="dateUpdate != null" >
  131. date_update,
  132. </if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides="," >
  135. <if test="id != null" >
  136. #{id,jdbcType=INTEGER},
  137. </if>
  138. <if test="planId != null" >
  139. #{planId,jdbcType=VARCHAR},
  140. </if>
  141. <if test="planName != null" >
  142. #{planName,jdbcType=VARCHAR},
  143. </if>
  144. <if test="planUserId != null" >
  145. #{planUserId,jdbcType=VARCHAR},
  146. </if>
  147. <if test="userId != null" >
  148. #{userId,jdbcType=VARCHAR},
  149. </if>
  150. <if test="planDate != null" >
  151. #{planDate,jdbcType=TIMESTAMP},
  152. </if>
  153. <if test="planStartDate != null" >
  154. #{planStartDate,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="planEndDate != null" >
  157. #{planEndDate,jdbcType=TIMESTAMP},
  158. </if>
  159. <if test="taskContent != null" >
  160. #{taskContent,jdbcType=VARCHAR},
  161. </if>
  162. <if test="taskAreaShape != null" >
  163. #{taskAreaShape,jdbcType=VARCHAR},
  164. </if>
  165. <if test="taskAreaName != null" >
  166. #{taskAreaName,jdbcType=VARCHAR},
  167. </if>
  168. <if test="taskType != null" >
  169. #{taskType,jdbcType=INTEGER},
  170. </if>
  171. <if test="planStatus != null" >
  172. #{planStatus,jdbcType=INTEGER},
  173. </if>
  174. <if test="tenantId != null" >
  175. #{tenantId,jdbcType=VARCHAR},
  176. </if>
  177. <if test="processInstanceId != null" >
  178. #{processInstanceId,jdbcType=VARCHAR},
  179. </if>
  180. <if test="processDefId != null" >
  181. #{processDefId,jdbcType=VARCHAR},
  182. </if>
  183. <if test="currentTaskId != null" >
  184. #{currentTaskId,jdbcType=VARCHAR},
  185. </if>
  186. <if test="currentUsers != null" >
  187. #{currentUsers,jdbcType=VARCHAR},
  188. </if>
  189. <if test="currentTaskName != null" >
  190. #{currentTaskName,jdbcType=VARCHAR},
  191. </if>
  192. <if test="createBy != null" >
  193. #{createBy,jdbcType=VARCHAR},
  194. </if>
  195. <if test="dateCreate != null" >
  196. #{dateCreate,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="updateBy != null" >
  199. #{updateBy,jdbcType=VARCHAR},
  200. </if>
  201. <if test="dateUpdate != null" >
  202. #{dateUpdate,jdbcType=TIMESTAMP},
  203. </if>
  204. </trim>
  205. </insert>
  206. <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.task.entity.PlanManage" >
  207. update sc_plan_manage
  208. <set >
  209. <if test="planId != null" >
  210. plan_id = #{planId,jdbcType=VARCHAR},
  211. </if>
  212. <if test="planName != null" >
  213. plan_name = #{planName,jdbcType=VARCHAR},
  214. </if>
  215. <if test="planUserId != null" >
  216. plan_user_id = #{planUserId,jdbcType=VARCHAR},
  217. </if>
  218. <if test="userId != null" >
  219. user_id = #{userId,jdbcType=VARCHAR},
  220. </if>
  221. <if test="planDate != null" >
  222. plan_date = #{planDate,jdbcType=TIMESTAMP},
  223. </if>
  224. <if test="planStartDate != null" >
  225. plan_start_date = #{planStartDate,jdbcType=TIMESTAMP},
  226. </if>
  227. <if test="planEndDate != null" >
  228. plan_end_date = #{planEndDate,jdbcType=TIMESTAMP},
  229. </if>
  230. <if test="taskContent != null" >
  231. task_content = #{taskContent,jdbcType=VARCHAR},
  232. </if>
  233. <if test="taskAreaShape != null" >
  234. task_area_shape = #{taskAreaShape,jdbcType=VARCHAR},
  235. </if>
  236. <if test="taskAreaName != null" >
  237. task_area_name = #{taskAreaName,jdbcType=VARCHAR},
  238. </if>
  239. <if test="taskType != null" >
  240. task_type = #{taskType,jdbcType=INTEGER},
  241. </if>
  242. <if test="planStatus != null" >
  243. plan_status = #{planStatus,jdbcType=INTEGER},
  244. </if>
  245. <if test="tenantId != null" >
  246. tenant_id = #{tenantId,jdbcType=VARCHAR},
  247. </if>
  248. <if test="processInstanceId != null" >
  249. process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
  250. </if>
  251. <if test="processDefId != null" >
  252. process_def_id = #{processDefId,jdbcType=VARCHAR},
  253. </if>
  254. <if test="currentTaskId != null" >
  255. current_task_id = #{currentTaskId,jdbcType=VARCHAR},
  256. </if>
  257. <if test="currentUsers != null" >
  258. current_users = #{currentUsers,jdbcType=VARCHAR},
  259. </if>
  260. <if test="currentTaskName != null" >
  261. current_task_name = #{currentTaskName,jdbcType=VARCHAR},
  262. </if>
  263. <if test="createBy != null" >
  264. create_by = #{createBy,jdbcType=VARCHAR},
  265. </if>
  266. <if test="dateCreate != null" >
  267. date_create = #{dateCreate,jdbcType=TIMESTAMP},
  268. </if>
  269. <if test="updateBy != null" >
  270. update_by = #{updateBy,jdbcType=VARCHAR},
  271. </if>
  272. <if test="dateUpdate != null" >
  273. date_update = #{dateUpdate,jdbcType=TIMESTAMP},
  274. </if>
  275. </set>
  276. where id = #{id,jdbcType=INTEGER}
  277. </update>
  278. <select id="selectPlanByIdAndDate" resultMap="BaseResultMap" parameterType="java.lang.String" >
  279. select
  280. <include refid="Base_Column_List"/>
  281. from sc_plan_manage
  282. where
  283. tenant_id = #{tenantId, jdbcType = VARCHAR}
  284. and plan_user_id in
  285. <foreach collection="userIdList" item="item" index="index" open="(" separator="," close=")">
  286. #{item,jdbcType=VARCHAR}
  287. </foreach>
  288. <if test="key != null and key != ''">
  289. and plan_id like "%" || #{planId,jdbcType=VARCHAR} || "%" or plan_name like "%" || #{planName,jdbcType=VARCHAR} || "%"
  290. </if>
  291. order by date_create desc
  292. </select>
  293. </mapper>