保存抓取规则功能
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>
|
||||
Reference in New Issue
Block a user