Digital Office Automation System Backend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XxlJobLogGlueMapper.xml 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.xxl.job.admin.dao.XxlJobLogGlueDao">
  5. <resultMap id="XxlJobLogGlue" type="com.xxl.job.admin.core.model.XxlJobLogGlue" >
  6. <result column="id" property="id" />
  7. <result column="job_id" property="jobId" />
  8. <result column="glue_type" property="glueType" />
  9. <result column="glue_source" property="glueSource" />
  10. <result column="glue_remark" property="glueRemark" />
  11. <result column="add_time" property="addTime" />
  12. <result column="update_time" property="updateTime" />
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. t.id,
  16. t.job_id,
  17. t.glue_type,
  18. t.glue_source,
  19. t.glue_remark,
  20. t.add_time,
  21. t.update_time
  22. </sql>
  23. <insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobLogGlue" useGeneratedKeys="true" keyProperty="id" >
  24. INSERT INTO xxl_job_logglue (
  25. `job_id`,
  26. `glue_type`,
  27. `glue_source`,
  28. `glue_remark`,
  29. `add_time`,
  30. `update_time`
  31. ) VALUES (
  32. #{jobId},
  33. #{glueType},
  34. #{glueSource},
  35. #{glueRemark},
  36. #{addTime},
  37. #{updateTime}
  38. );
  39. <!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
  40. SELECT LAST_INSERT_ID()
  41. </selectKey>-->
  42. </insert>
  43. <select id="findByJobId" parameterType="java.lang.Integer" resultMap="XxlJobLogGlue">
  44. SELECT <include refid="Base_Column_List" />
  45. FROM xxl_job_logglue AS t
  46. WHERE t.job_id = #{jobId}
  47. ORDER BY id DESC
  48. </select>
  49. <delete id="removeOld" >
  50. DELETE FROM xxl_job_logglue
  51. WHERE id NOT in(
  52. SELECT id FROM(
  53. SELECT id FROM xxl_job_logglue
  54. WHERE `job_id` = #{jobId}
  55. ORDER BY update_time desc
  56. LIMIT 0, #{limit}
  57. ) t1
  58. ) AND `job_id` = #{jobId}
  59. </delete>
  60. <delete id="deleteByJobId" parameterType="java.lang.Integer" >
  61. DELETE FROM xxl_job_logglue
  62. WHERE `job_id` = #{jobId}
  63. </delete>
  64. </mapper>