调解系统后端服务

TemplateFatchRuleMapper.xml 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.template.TemplateFatchRuleMapper">
  6. <resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" >
  7. <result column="id" property="id" />
  8. <result column="template_id" property="templateId" />
  9. <result column="fatch_rule_id" property="fatchRuleId" />
  10. </resultMap>
  11. <select id="selectTemplateFatchRulecount" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" resultType="Integer">
  12. select count(1) from ms_template_fatch_rule t
  13. <where>
  14. <if test="templateId != null">
  15. AND t.template_id = #{templateId}
  16. </if>
  17. </where>
  18. </select>
  19. <select id="selectTemplateFatchRuleList" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" resultMap="BaseResultMap">
  20. SELECT t.id ,t.template_id ,t.fatch_rule_id
  21. from ms_template_fatch_rule t
  22. <where>
  23. <if test="templateId != null">
  24. AND t.template_id = #{templateId}
  25. </if>
  26. </where>
  27. </select>
  28. <delete id="deleteTemplateFatchRule" parameterType="Long">
  29. delete from ms_template_fatch_rule where template_id=#{id}
  30. </delete>
  31. <insert id="insertTemplateFatchRule" parameterType="com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule" useGeneratedKeys="true" keyProperty="id">
  32. insert into ms_template_fatch_rule(
  33. <if test="templateId != null">template_id,</if>
  34. <if test="fatchRuleId != null">fatch_rule_id</if>
  35. )values(
  36. <if test="templateId != null">#{templateId},</if>
  37. <if test="fatchRuleId != null">#{fatchRuleId}</if>
  38. )
  39. </insert>
  40. </mapper>