Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/FatchRuleMapper.xml
T
2023-12-08 17:59:09 +08:00

108 lines
4.6 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.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="column_name" property="columnName" />
</resultMap>
<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}
</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="selectColumnandComment" parameterType="FatchRule" resultMap="BaseResultMap">
select
a.COLUMN_name as `column`,
a.COLumn_comment as column_name
from
information_schema.COLUMNS a
where
TABLE_schema = #{databaseName}
and TABLE_name in('case_application','case_affiliate')
and COLUMN_NAME not in('id','case_appli_id','case_num','case_subject_amount',
'register_date','arbitrat_method','case_status','hear_date','begin_video_date',
'online_video_person','create_time','update_by','update_time','create_by',
'arbitrator_id','arbitrator_name','pended_trial_arbitorid','pending_appoint_arbotrar',
'case_name','case_result','is_agree_pend_tral','objection_add_eviden','open_court_hear',
'paid_expenses','filearbitra_url','pay_type','adjudica_counter','proper_preser','objecti_juris',
'is_absence','respon_cross_opin','applica_cross_opin','respon_defen_opini','appli_is_absen',
'lock_status','room_id','import_flag','version','batch_number','template_id','applicant_agent_user_id','contract_number','identity_type','application_organ_id')
</select>
<select id="selectColumnbycomment" parameterType="FatchRule" resultMap="BaseResultMap">
select
COLUMN_NAME
from
information_schema.COLUMNS
where
TABLE_schema = #{databaseName}
and TABLE_name in('case_application','case_affiliate')
and COLumn_comment = #{columnName}
</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>