提交 | 用户 | 时间
|
722af2
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
X |
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.XxlJobLogReportDao"> |
|
5 |
|
|
6 |
<resultMap id="XxlJobLogReport" type="com.xxl.job.admin.core.model.XxlJobLogReport" > |
|
7 |
<result column="id" property="id" /> |
|
8 |
<result column="trigger_day" property="triggerDay" /> |
|
9 |
<result column="running_count" property="runningCount" /> |
|
10 |
<result column="suc_count" property="sucCount" /> |
|
11 |
<result column="fail_count" property="failCount" /> |
|
12 |
</resultMap> |
|
13 |
|
|
14 |
<sql id="Base_Column_List"> |
|
15 |
t.id, |
|
16 |
t.trigger_day, |
|
17 |
t.running_count, |
|
18 |
t.suc_count, |
|
19 |
t.fail_count |
|
20 |
</sql> |
|
21 |
|
|
22 |
<insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobLogReport" useGeneratedKeys="true" keyProperty="id" > |
|
23 |
INSERT INTO xxl_job_log_report ( |
|
24 |
`trigger_day`, |
|
25 |
`running_count`, |
|
26 |
`suc_count`, |
|
27 |
`fail_count` |
|
28 |
) VALUES ( |
|
29 |
#{triggerDay}, |
|
30 |
#{runningCount}, |
|
31 |
#{sucCount}, |
|
32 |
#{failCount} |
|
33 |
); |
|
34 |
<!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
|
35 |
SELECT LAST_INSERT_ID() |
|
36 |
</selectKey>--> |
|
37 |
</insert> |
|
38 |
|
|
39 |
<update id="update" > |
|
40 |
UPDATE xxl_job_log_report |
|
41 |
SET `running_count` = #{runningCount}, |
|
42 |
`suc_count` = #{sucCount}, |
|
43 |
`fail_count` = #{failCount} |
|
44 |
WHERE `trigger_day` = #{triggerDay} |
|
45 |
</update> |
|
46 |
|
|
47 |
<select id="queryLogReport" resultMap="XxlJobLogReport"> |
|
48 |
SELECT <include refid="Base_Column_List" /> |
|
49 |
FROM xxl_job_log_report AS t |
|
50 |
WHERE t.trigger_day between #{triggerDayFrom} and #{triggerDayTo} |
|
51 |
ORDER BY t.trigger_day ASC |
|
52 |
</select> |
|
53 |
|
|
54 |
<select id="queryLogReportTotal" resultMap="XxlJobLogReport"> |
|
55 |
SELECT |
|
56 |
SUM(running_count) running_count, |
|
57 |
SUM(suc_count) suc_count, |
|
58 |
SUM(fail_count) fail_count |
|
59 |
FROM xxl_job_log_report AS t |
|
60 |
</select> |
|
61 |
|
|
62 |
</mapper> |