智能仲裁后端服务

FatchRuleMapper.xml 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.FatchRuleMapper">
  6. <resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.FatchRule" >
  7. <result column="id" property="id" />
  8. <result column="batch_number" property="batchNumber" />
  9. <result column="file_name" property="fileName" />
  10. <result column="start_content" property="startContent" />
  11. <result column="end_content" property="endContent" />
  12. <result column="column" property="column" />
  13. <result column="column_name" property="columnName" />
  14. <result column="is_default" property="isDefault" />
  15. </resultMap>
  16. <select id="listByTemplateId" resultMap="BaseResultMap">
  17. select fr.* from fatch_rule fr join template_fatch_rule tfr on fr.id=tfr.fatch_rule_id
  18. where template_id=#{templateId}
  19. </select>
  20. <select id="selectFatchRuleList" parameterType="FatchRule" resultMap="BaseResultMap">
  21. SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
  22. f.`column` ,f.is_default ,f.`column_name`
  23. FROM template_fatch_rule tf
  24. left join template_manage t on tf.template_id = t.id
  25. LEFT JOIN fatch_rule f on tf.fatch_rule_id = f.id
  26. <where>
  27. <if test="templateId != null">
  28. AND tf.template_id = #{templateId}
  29. </if>
  30. </where>
  31. </select>
  32. <select id="selectColumnandComment" parameterType="FatchRule" resultMap="BaseResultMap">
  33. select
  34. a.COLUMN_name as `column`,
  35. a.COLumn_comment as column_name
  36. from
  37. information_schema.COLUMNS a
  38. where
  39. TABLE_schema = #{databaseName}
  40. and TABLE_name in('case_application','case_affiliate')
  41. and COLUMN_NAME not in('id','case_appli_id','case_num','case_subject_amount',
  42. 'register_date','arbitrat_method','case_status','hear_date','begin_video_date',
  43. 'online_video_person','create_time','update_by','update_time','create_by',
  44. 'arbitrator_id','arbitrator_name','pended_trial_arbitorid','pending_appoint_arbotrar',
  45. 'case_name','case_result','is_agree_pend_tral','objection_add_eviden','open_court_hear',
  46. 'paid_expenses','filearbitra_url','pay_type','adjudica_counter','proper_preser','objecti_juris',
  47. 'is_absence','respon_cross_opin','applica_cross_opin','respon_defen_opini','appli_is_absen',
  48. 'lock_status','room_id','import_flag','version','batch_number','template_id','applicant_agent_user_id','contract_number','identity_type','application_organ_id')
  49. </select>
  50. <select id="selectColumnbycomment" parameterType="FatchRule" resultMap="BaseResultMap">
  51. select
  52. COLUMN_NAME
  53. from
  54. information_schema.COLUMNS
  55. where
  56. TABLE_schema = #{databaseName}
  57. and TABLE_name in('case_application','case_affiliate')
  58. and COLumn_comment = #{columnName}
  59. </select>
  60. <select id="selectFatchRuleListIsDefault" parameterType="FatchRule" resultMap="BaseResultMap">
  61. SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
  62. f.`column` ,f.is_default ,f.`column_name`
  63. FROM fatch_rule f
  64. <where>
  65. <if test="isDefault != null">
  66. AND f.is_default = #{isDefault}
  67. </if>
  68. </where>
  69. </select>
  70. <delete id="deletebatchFatchRule">
  71. delete from fatch_rule where id in
  72. <foreach collection="fatchRuleIds" item="item" open="(" separator="," close=")">
  73. #{item}
  74. </foreach>
  75. </delete>
  76. <insert id="insertFatchRule" parameterType="FatchRule" useGeneratedKeys="true" keyProperty="id">
  77. insert into fatch_rule(
  78. <if test="fileName != null and fileName != ''">file_name,</if>
  79. <if test="startContent != null and startContent != ''">start_content,</if>
  80. <if test="endContent != null and endContent != ''">end_content,</if>
  81. <if test="column != null and column != ''">`column`,</if>
  82. <if test="columnName != null and columnName != ''">`column_name`,</if>
  83. <if test="isDefault != null">is_default</if>
  84. )values(
  85. <if test="fileName != null and fileName != ''">#{fileName},</if>
  86. <if test="startContent != null and startContent != ''">#{startContent},</if>
  87. <if test="endContent != null and endContent != ''">#{endContent},</if>
  88. <if test="column != null and column != ''">#{column},</if>
  89. <if test="columnName != null and columnName != ''">#{columnName},</if>
  90. <if test="isDefault != null">#{isDefault}</if>
  91. )
  92. </insert>
  93. </mapper>