GoafCheckDefMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafCheckDefMapper">
  5. <resultMap id="GoafCheckDefMapper" type="com.zhyc.xps.goaf.entity.GoafCheckDef">
  6. <id column="check_def_id" property="checkDefId" jdbcType="BIGINT"/>
  7. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  8. <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
  9. <result column="check_title" property="checkTitle" jdbcType="VARCHAR"/>
  10. <result column="check_type_id" property="checkTypeId" jdbcType="BIGINT"/>
  11. <result column="group_id" property="groupId" jdbcType="BIGINT"/>
  12. <result column="position_id" property="positionId" jdbcType="BIGINT"/>
  13. <result column="account_id" property="accountId" jdbcType="BIGINT"/>
  14. <result column="account_name" property="accountName" jdbcType="VARCHAR"/>
  15. <result column="position_name" property="positionName" jdbcType="VARCHAR"/>
  16. <result column="group_name" property="groupName" jdbcType="VARCHAR"/>
  17. <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
  18. <result column="checklist_title" property="checklistTitle" jdbcType="VARCHAR"/>
  19. <result column="def_start_date" property="defStartDate" jdbcType="DATE"/>
  20. <result column="def_end_date" property="defEndDate" jdbcType="DATE"/>
  21. <result column="check_count" property="checkCount" jdbcType="BIGINT"/>
  22. <result column="check_cycle_unit" property="checkCycleUnit" jdbcType="BIGINT"/>
  23. <result column="job_id" property="jobId" jdbcType="BIGINT"/>
  24. <result column="check_desc" property="checkDesc" jdbcType="VARCHAR"/>
  25. <result column="status" property="status" jdbcType="BIGINT"/>
  26. </resultMap>
  27. <select id="getByList" parameterType="java.util.Map" resultMap="GoafCheckDefMapper">
  28. SELECT *
  29. FROM goaf_check_def
  30. WHERE 1=1
  31. <if test="ocId !=null">
  32. AND oc_id = #{ocId ,jdbcType=BIGINT}
  33. </if>
  34. <if test="goafId !=null">
  35. AND goaf_id = #{goafId ,jdbcType=BIGINT}
  36. </if>
  37. <if test="groupId !=null">
  38. AND group_id = #{groupId ,jdbcType=BIGINT}
  39. </if>
  40. <if test="accountId !=null">
  41. AND account_id = #{accountId ,jdbcType=BIGINT}
  42. </if>
  43. <if test="jobId !=null">
  44. AND job_id = #{jobId ,jdbcType=BIGINT}
  45. </if>
  46. <if test="status !=null">
  47. AND status = #{status ,jdbcType=BIGINT}
  48. </if>
  49. </select>
  50. <!--分页查询-->
  51. <select id="getByPage" parameterType="java.util.Map" resultMap="GoafCheckDefMapper">
  52. SELECT *
  53. FROM goaf_check_def
  54. WHERE 1=1
  55. <if test="ocId !=null">
  56. AND oc_id = #{ocId ,jdbcType=BIGINT}
  57. </if>
  58. <if test="goafId !=null">
  59. AND goaf_id = #{goafId ,jdbcType=BIGINT}
  60. </if>
  61. <if test="groupId !=null">
  62. AND group_id = #{groupId ,jdbcType=BIGINT}
  63. </if>
  64. <if test="accountId !=null">
  65. AND account_id = #{accountId ,jdbcType=BIGINT}
  66. </if>
  67. <if test="jobId !=null">
  68. AND job_id = #{jobId ,jdbcType=BIGINT}
  69. </if>
  70. <if test="status !=null">
  71. AND status = #{status ,jdbcType=BIGINT}
  72. </if>
  73. </select>
  74. <select id="getByjobId" resultMap="GoafCheckDefMapper">
  75. SELECT *
  76. FROM goaf_check_def
  77. WHERE WHERE oc_id = #{ocId ,jdbcType=BIGINT} AND goaf_id = #{goafId, jdbcType=BIGINT}
  78. </select>
  79. <select id="getBycheckDefId" resultMap="GoafCheckDefMapper">
  80. SELECT *
  81. FROM goaf_check_def
  82. WHERE check_def_id = #{checkDefId, jdbcType=BIGINT}
  83. </select>
  84. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafCheckDef">
  85. insert into goaf_check_def
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <if test="checkDefId != null">
  88. check_def_id,
  89. </if>
  90. <if test="ocId != null">
  91. oc_id,
  92. </if>
  93. <if test="goafId != null">
  94. goaf_id,
  95. </if>
  96. <if test="checkTitle != null and checkTitle != ''">
  97. check_title,
  98. </if>
  99. <if test="checkTypeId != null">
  100. check_type_id,
  101. </if>
  102. <if test="groupId != null">
  103. group_id,
  104. </if>
  105. <if test="positionId != null">
  106. position_id,
  107. </if>
  108. <if test="accountId != null">
  109. account_id,
  110. </if>
  111. <if test="accountName != null and accountName != ''">
  112. account_name,
  113. </if>
  114. <if test="positionName != null and positionName != ''">
  115. position_name,
  116. </if>
  117. <if test="groupName != null and groupName != ''">
  118. group_name,
  119. </if>
  120. <if test="checklistId != null">
  121. checklist_id,
  122. </if>
  123. <if test="checklistTitle != null and checklistTitle != ''">
  124. checklist_title,
  125. </if>
  126. <if test="defStartDate != null">
  127. def_start_date,
  128. </if>
  129. <if test="defEndDate != null">
  130. def_end_date,
  131. </if>
  132. <if test="checkCount != null">
  133. check_count,
  134. </if>
  135. <if test="checkCycleUnit != null">
  136. check_cycle_unit,
  137. </if>
  138. <if test="jobId != null">
  139. job_id,
  140. </if>
  141. <if test="checkDesc != null and checkDesc != ''">
  142. check_desc,
  143. </if>
  144. <if test="status != null">
  145. status,
  146. </if>
  147. <if test="createdBy != null">
  148. created_by,
  149. </if>
  150. <if test="createdAt != null">
  151. created_at,
  152. </if>
  153. </trim>
  154. <trim prefix="values (" suffix=")" suffixOverrides=",">
  155. <if test="checkDefId != null">
  156. #{checkDefId, jdbcType=BIGINT},
  157. </if>
  158. <if test="ocId != null">
  159. #{ocId, jdbcType=BIGINT},
  160. </if>
  161. <if test="goafId != null">
  162. #{goafId, jdbcType=BIGINT},
  163. </if>
  164. <if test="checkTitle != null and checkTitle != ''">
  165. #{checkTitle, jdbcType=VARCHAR},
  166. </if>
  167. <if test="checkTypeId != null">
  168. #{checkTypeId, jdbcType=BIGINT},
  169. </if>
  170. <if test="groupId != null">
  171. #{groupId, jdbcType=BIGINT},
  172. </if>
  173. <if test="positionId != null">
  174. #{positionId, jdbcType=BIGINT},
  175. </if>
  176. <if test="accountId != null">
  177. #{accountId, jdbcType=BIGINT},
  178. </if>
  179. <if test="accountName != null and accountName != ''">
  180. #{accountName, jdbcType=VARCHAR},
  181. </if>
  182. <if test="positionName != null and positionName != ''">
  183. #{positionName, jdbcType=VARCHAR},
  184. </if>
  185. <if test="groupName != null and groupName != ''">
  186. #{groupName, jdbcType=VARCHAR},
  187. </if>
  188. <if test="checklistId != null">
  189. #{checklistId, jdbcType=BIGINT},
  190. </if>
  191. <if test="checklistTitle != null and checklistTitle != ''">
  192. #{checklistTitle, jdbcType=VARCHAR},
  193. </if>
  194. <if test="defStartDate != null">
  195. #{defStartDate, jdbcType=DATE},
  196. </if>
  197. <if test="defEndDate != null">
  198. #{defEndDate, jdbcType=DATE},
  199. </if>
  200. <if test="checkCount != null">
  201. #{checkCount, jdbcType=BIGINT},
  202. </if>
  203. <if test="checkCycleUnit != null">
  204. #{checkCycleUnit, jdbcType=BIGINT},
  205. </if>
  206. <if test="jobId != null">
  207. #{jobId, jdbcType=BIGINT},
  208. </if>
  209. <if test="checkDesc != null and checkDesc != ''">
  210. #{checkDesc, jdbcType=VARCHAR},
  211. </if>
  212. <if test="status != null">
  213. #{status, jdbcType=BIGINT},
  214. </if>
  215. <if test="createdBy != null">
  216. #{createdBy ,jdbcType=BIGINT},
  217. </if>
  218. <if test="createdAt != null">
  219. #{createdAt ,jdbcType=TIMESTAMP},
  220. </if>
  221. </trim>
  222. </insert>
  223. <!--Update更新-->
  224. <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafCheckDef">
  225. UPDATE goaf_check_def
  226. <trim suffixOverrides=",">
  227. <set>
  228. <if test="checkTitle != null">
  229. check_title =#{checkTitle ,jdbcType=VARCHAR},
  230. </if>
  231. <if test="checkDesc != null and checkDesc != ''">
  232. check_desc = #{checkDesc ,jdbcType=VARCHAR},
  233. </if>
  234. <if test="groupId != null">
  235. group_id = #{groupId ,jdbcType=BIGINT},
  236. </if>
  237. <if test="groupName != null and groupName!=''">
  238. group_name = #{groupName, jdbcType=VARCHAR},
  239. </if>
  240. <if test="accountId != null">
  241. account_id = #{accountId ,jdbcType=BIGINT},
  242. </if>
  243. <if test="accountName != null and accountName!=''">
  244. account_name = #{accountName, jdbcType=VARCHAR},
  245. </if>
  246. <if test="checkCount != null">
  247. check_count = #{checkCount ,jdbcType=INTEGER},
  248. </if>
  249. <if test="defStartDate != null">
  250. def_start_date = #{defStartDate ,jdbcType=DATE},
  251. </if>
  252. <if test="defEndDate != null">
  253. def_end_date = #{defEndDate ,jdbcType=DATE},
  254. </if>
  255. <if test="jobId != null">
  256. job_id = #{jobId ,jdbcType=BIGINT},
  257. </if>
  258. <if test="checkCycleUnit != null">
  259. check_cycle_unit = #{checkCycleUnit, jdbcType=BIGINT},
  260. </if>
  261. <if test="status != null">
  262. status = #{status, jdbcType=BIGINT},
  263. </if>
  264. <if test="checklistId != null">
  265. checklist_id = #{checklistId, jdbcType=BIGINT},
  266. </if>
  267. <if test="checklistTitle != null and checklistTitle!=''">
  268. checklist_title = #{checklistTitle, jdbcType=VARCHAR},
  269. </if>
  270. <if test="updatedBy != null">
  271. updated_by = #{updatedBy ,jdbcType=BIGINT},
  272. </if>
  273. <if test="updatedAt != null">
  274. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  275. </if>
  276. </set>
  277. </trim>
  278. WHERE check_def_id = #{checkDefId ,jdbcType=BIGINT}
  279. </update>
  280. <delete id="delete" >
  281. DELETE FROM goaf_check_def
  282. WHERE check_def_id = #{checkDefId, jdbcType=BIGINT}
  283. </delete>
  284. <!-- <update id="delete" parameterType="java.util.Map">-->
  285. <!-- UPDATE goaf_check_def-->
  286. <!-- <trim suffixOverrides=",">-->
  287. <!-- <set>-->
  288. <!-- <if test="deletedBy != null">-->
  289. <!-- deleted_by = #{deletedBy ,jdbcType=BIGINT},-->
  290. <!-- </if>-->
  291. <!-- <if test="deletedAt != null">-->
  292. <!-- deleted_at = #{deletedAt ,jdbcType=DATE},-->
  293. <!-- </if>-->
  294. <!-- <if test="deletedFlag != null">-->
  295. <!-- deleted_flag = #{deletedFlag ,jdbcType=BIGINT},-->
  296. <!-- </if>-->
  297. <!-- </set>-->
  298. <!-- </trim>-->
  299. <!-- WHERE deleted_flag = 0-->
  300. <!-- <if test="ocId != null">-->
  301. <!-- AND oc_id = #{ocId,jdbcType=BIGINT}-->
  302. <!-- </if>-->
  303. <!-- <if test="goafId != null">-->
  304. <!-- AND goaf_id = #{goafId ,jdbcType=BIGINT}-->
  305. <!-- </if>-->
  306. <!-- <if test="checkDefId != null ">-->
  307. <!-- AND check_def_id = #{checkDefId ,jdbcType=BIGINT}-->
  308. <!-- </if>-->
  309. <!-- </update>-->
  310. </mapper>