2023-12-06 10:43:41 +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">
|
|
|
|
|
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.FatchRuleMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.FatchRule" >
|
|
|
|
|
<result column="id" property="id" />
|
2023-12-07 09:29:33 +08:00
|
|
|
<result column="batch_number" property="batchNumber" />
|
2023-12-06 10:43:41 +08:00
|
|
|
<result column="file_name" property="fileName" />
|
|
|
|
|
<result column="start_content" property="startContent" />
|
|
|
|
|
<result column="end_content" property="endContent" />
|
2023-12-06 17:30:37 +08:00
|
|
|
<result column="column" property="column" />
|
2023-12-07 09:29:33 +08:00
|
|
|
<result column="column_name" property="columnName" />
|
2023-12-06 10:43:41 +08:00
|
|
|
</resultMap>
|
2023-12-07 09:29:33 +08:00
|
|
|
<select id="listByTemplateId" resultMap="BaseResultMap">
|
|
|
|
|
select fr.* from fatch_rule fr join template_fatch_rule tfr on fr.id=tfr.fatch_rule_id
|
|
|
|
|
where template_id=#{templateId}
|
2023-12-06 10:43:41 +08:00
|
|
|
</select>
|
|
|
|
|
|
2023-12-06 17:30:37 +08:00
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 10:43:41 +08:00
|
|
|
|
|
|
|
|
</mapper>
|