RuleNumSchedulingMapper.xml
2.98 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?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="com.ruoyi.schedulingAssociateNum.mapper.RuleNumSchedulingMapper">
<resultMap type="RuleNumScheduling" id="RuleNumSchedulingResult">
<result property="id" column="id" />
<result property="ruleNumId" column="rule_num_id" />
<result property="ruleSchedulingId" column="rule_scheduling_id" />
<result property="matchName" column="match_name" />
</resultMap>
<sql id="selectRuleNumSchedulingVo">
select id, rule_num_id, rule_scheduling_id, match_name from rule_num_scheduling
</sql>
<select id="selectRuleNumSchedulingList" parameterType="RuleNumScheduling" resultMap="RuleNumSchedulingResult">
<include refid="selectRuleNumSchedulingVo"/>
<where>
<if test="ruleNumId != null "> and rule_num_id = #{ruleNumId}</if>
<if test="ruleSchedulingId != null and ruleSchedulingId != ''"> and rule_scheduling_id = #{ruleSchedulingId}</if>
<if test="matchName != null and matchName != ''"> and match_name like concat('%', #{matchName}, '%')</if>
</where>
</select>
<select id="selectRuleNumSchedulingById" parameterType="Long" resultMap="RuleNumSchedulingResult">
<include refid="selectRuleNumSchedulingVo"/>
where id = #{id}
</select>
<insert id="insertRuleNumScheduling" parameterType="RuleNumScheduling" useGeneratedKeys="true" keyProperty="id">
insert into rule_num_scheduling
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ruleNumId != null">rule_num_id,</if>
<if test="ruleSchedulingId != null">rule_scheduling_id,</if>
<if test="matchName != null">match_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ruleNumId != null">#{ruleNumId},</if>
<if test="ruleSchedulingId != null">#{ruleSchedulingId},</if>
<if test="matchName != null">#{matchName},</if>
</trim>
</insert>
<update id="updateRuleNumScheduling" parameterType="RuleNumScheduling">
update rule_num_scheduling
<trim prefix="SET" suffixOverrides=",">
<if test="ruleNumId != null">rule_num_id = #{ruleNumId},</if>
<if test="ruleSchedulingId != null">rule_scheduling_id = #{ruleSchedulingId},</if>
<if test="matchName != null">match_name = #{matchName},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRuleNumSchedulingById" parameterType="Long">
delete from rule_num_scheduling where id = #{id}
</delete>
<delete id="deleteRuleNumSchedulingByIds" parameterType="String">
delete from rule_num_scheduling where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>