Files
Mediation-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateFatchRuleMapper.xml
T

49 lines
1.9 KiB
XML
Raw Normal View History

2024-01-04 16:58:19 +08:00
<?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">
2024-01-05 18:14:54 +08:00
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.template.TemplateFatchRuleMapper">
2024-01-04 16:58:19 +08:00
2024-01-05 18:14:54 +08:00
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" >
2024-01-04 16:58:19 +08:00
<result column="id" property="id" />
<result column="template_id" property="templateId" />
<result column="fatch_rule_id" property="fatchRuleId" />
</resultMap>
2024-01-08 15:05:57 +08:00
<select id="selectTemplateFatchRulecount" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" resultType="Integer">
2024-01-05 11:54:46 +08:00
select count(1) from ms_template_fatch_rule t
2024-01-04 16:58:19 +08:00
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
2024-01-08 15:05:57 +08:00
<select id="selectTemplateFatchRuleList" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" resultMap="BaseResultMap">
2024-01-04 16:58:19 +08:00
SELECT t.id ,t.template_id ,t.fatch_rule_id
2024-01-05 11:54:46 +08:00
from ms_template_fatch_rule t
2024-01-04 16:58:19 +08:00
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
<delete id="deleteTemplateFatchRule" parameterType="Long">
2024-01-05 11:54:46 +08:00
delete from ms_template_fatch_rule where template_id=#{id}
2024-01-04 16:58:19 +08:00
</delete>
2024-01-08 15:05:57 +08:00
<insert id="insertTemplateFatchRule" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" useGeneratedKeys="true" keyProperty="id">
2024-01-05 11:54:46 +08:00
insert into ms_template_fatch_rule(
2024-01-04 16:58:19 +08:00
<if test="templateId != null">template_id,</if>
<if test="fatchRuleId != null">fatch_rule_id</if>
)values(
<if test="templateId != null">#{templateId},</if>
<if test="fatchRuleId != null">#{fatchRuleId}</if>
)
</insert>
</mapper>