保存抓取规则功能
This commit is contained in:
@@ -5,14 +5,71 @@
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.FatchRuleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.FatchRule" >
|
||||
<result column="id" property="id" />
|
||||
<result column="batch_number" property="batchNumber" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="start_content" property="startContent" />
|
||||
<result column="end_content" property="endContent" />
|
||||
|
||||
<result column="column" property="column" />
|
||||
<result column="is_default" property="isDefault" />
|
||||
<result column="columnName" property="columnName" />
|
||||
</resultMap>
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
select * from fatch_rule where batch_number=#{batchNumber}
|
||||
</select>
|
||||
|
||||
<select id="selectFatchRuleList" parameterType="FatchRule" resultMap="BaseResultMap">
|
||||
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
|
||||
f.`column` ,f.is_default ,f.columnName
|
||||
FROM template_fatch_rule tf
|
||||
left join template_manage t on tf.template_id = t.id
|
||||
LEFT JOIN fatch_rule f on tf.fatch_rule_id = f.id
|
||||
<where>
|
||||
<if test="templateId != null">
|
||||
AND tf.template_id = #{templateId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFatchRuleListIsDefault" parameterType="FatchRule" resultMap="BaseResultMap">
|
||||
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
|
||||
f.`column` ,f.is_default ,f.columnName
|
||||
FROM fatch_rule f
|
||||
<where>
|
||||
<if test="isDefault != null">
|
||||
AND f.is_default = #{isDefault}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deletebatchFatchRule">
|
||||
delete from fatch_rule where id in
|
||||
<foreach collection="fatchRuleIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertFatchRule" parameterType="FatchRule" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fatch_rule(
|
||||
<if test="fileName != null and fileName != ''">file_name,</if>
|
||||
<if test="startContent != null and startContent != ''">start_content,</if>
|
||||
<if test="endContent != null and endContent != ''">end_content,</if>
|
||||
<if test="column != null and column != ''">`column`,</if>
|
||||
<if test="columnName != null and columnName != ''">columnName,</if>
|
||||
<if test="isDefault != null">is_default</if>
|
||||
)values(
|
||||
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||||
<if test="startContent != null and startContent != ''">#{startContent},</if>
|
||||
<if test="endContent != null and endContent != ''">#{endContent},</if>
|
||||
<if test="column != null and column != ''">#{column},</if>
|
||||
<if test="columnName != null and columnName != ''">#{columnName},</if>
|
||||
<if test="isDefault != null">#{isDefault}</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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 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 template_fatch_rule t
|
||||
<where>
|
||||
<if test="templateId != null">
|
||||
AND t.template_id = #{templateId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<delete id="deleteTemplateFatchRule" parameterType="Long">
|
||||
delete from template_fatch_rule where template_id=#{id}
|
||||
</delete>
|
||||
|
||||
<insert id="insertTemplateFatchRule" parameterType="TemplateFatchRule" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into 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>
|
||||
Reference in New Issue
Block a user