guoshilong
2023-05-18 6cd2da8eb7d7aefecd96a19ebbfe9caba59ea88c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.gistack.sm.exam.mapper.ExamPlanMapper">
 
    <resultMap id="selectExamPlan" type="cn.gistack.sm.exam.vo.ExamPlanVO">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="exam_period" property="examPeriod"/>
        <result column="cron_expression" property="cronExpression"/>
        <result column="exam_role" property="examRole"/>
        <result column="duty" property="duty"/>
        <result column="effective_time_start" property="effectiveTimeStart"/>
        <result column="effective_time_end" property="effectiveTimeEnd"/>
        <result column="remark" property="remark"/>
        <result column="status" property="status"/>
        <result column="examPeriodText" property="examPeriodText"/>
    </resultMap>
 
 
    <!--分页列表查询-->
    <select id="selectExamPlanPage" resultType="cn.gistack.sm.exam.vo.ExamPlanVO">
        select plan.id,plan.name,plan.exam_period,plan.cron_expression,plan.exam_role,plan.duty,plan.effective_time_start,plan.effective_time_end,plan.remark,plan.status,
            biz.dict_value examPeriodText
        from sm_exam_plan plan
        LEFT JOIN blade_dict_biz biz ON biz.dict_key = plan.exam_period AND biz.code = 'EXAM_PERIOD'
        where plan.is_deleted = 0
        <if test="examPlan.name !=null and examPlan.name !=''">
            AND plan.name LIKE CONCAT('%',#{examPlan.name},'%')
        </if>
        <if test="examPlan.examPeriod !=null and examPlan.examPeriod !=''">
            AND plan.exam_period = #{examPlan.examPeriod}
        </if>
        <if test="examPlan.status !=null and examPlan.status !='' ">
            AND plan.status = #{examPlan.status}
        </if>
        order by plan.id desc
    </select>
 
    <!--    设置启用或者禁用-->
    <update id="enableOrDisable">
        update sm_exam_plan
        <set >
            status = #{value}
        </set>
        where id = #{id}
    </update>
 
</mapper>