Files
Mediation-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateFatchRuleMapper.xml
T
2024-01-05 11:54:46 +08:00

49 lines
1.7 KiB
XML

<?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.wisdomarbitrate.mapper.TemplateFatchRuleMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.TemplateFatchRule" >
<result column="id" property="id" />
<result column="template_id" property="templateId" />
<result column="fatch_rule_id" property="fatchRuleId" />
</resultMap>
<select id="selectTemplateFatchRulecount" parameterType="TemplateFatchRule" resultType="Integer">
select count(1) from ms_template_fatch_rule t
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
<select id="selectTemplateFatchRuleList" parameterType="TemplateFatchRule" resultMap="BaseResultMap">
SELECT t.id ,t.template_id ,t.fatch_rule_id
from ms_template_fatch_rule t
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
<delete id="deleteTemplateFatchRule" parameterType="Long">
delete from ms_template_fatch_rule where template_id=#{id}
</delete>
<insert id="insertTemplateFatchRule" parameterType="TemplateFatchRule" useGeneratedKeys="true" keyProperty="id">
insert into ms_template_fatch_rule(
<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>