ScoringRulesMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.scene.mapper.ScoringRulesMapper" >
  4. <insert id="saveScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
  5. insert into simulation.scoring_rules
  6. (rules_id,rules_code,rule_name,rule_description,rule_details,
  7. create_user_id,create_time,modify_user_id,modify_time,
  8. is_deleted,share)
  9. values (#{rulesId,jdbcType=VARCHAR},#{rulesCode,jdbcType=VARCHAR},#{ruleName,jdbcType=VARCHAR},#{ruleDescription,jdbcType=VARCHAR},#{ruleDetails},
  10. #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
  11. #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
  12. </insert>
  13. <select id="queryScoringRulesList" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
  14. select
  15. rules_id,rules_code,rule_name,rule_description,rule_details,
  16. create_user_id,create_time,modify_user_id,modify_time,
  17. is_deleted,share
  18. from simulation.scoring_rules
  19. <where>
  20. is_deleted = '0'
  21. <if test="rulesId != null and rulesId != ''">
  22. and rules_id = #{rulesId,jdbcType=VARCHAR}
  23. </if>
  24. <if test="rulesCode != null and rulesCode != ''">
  25. and rules_code = #{rulesCode,jdbcType=VARCHAR}
  26. </if>
  27. <if test="share != null and share!=''">
  28. and share = #{share,jdbcType=VARCHAR}
  29. </if>
  30. <if test="ruleName != null and ruleName != ''">
  31. and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
  32. </if>
  33. <if test="ruleDescription != null and ruleDescription != ''">
  34. and rule_description like CONCAT('%',#{ruleDescription},'%')
  35. </if>
  36. <if test="yearMax != null and yearMax != ''">
  37. and #{yearMax,jdbcType=VARCHAR} &gt; create_time and #{yearMin,jdbcType=VARCHAR} &lt; create_time
  38. </if>
  39. <if test="createUserId != null and createUserId != ''">
  40. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  41. </if>
  42. order by modify_time desc
  43. </where>
  44. </select>
  45. <select id="queryScoringRules" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
  46. select
  47. rules_id,rule_name,rule_description,rule_details,
  48. create_user_id,create_time,modify_user_id,modify_time,
  49. is_deleted,share
  50. from simulation.scoring_rules
  51. <where>
  52. is_deleted = '0'
  53. <if test="rulesId != null and rulesId != ''">
  54. and rules_id = #{rulesId,jdbcType=VARCHAR}
  55. </if>
  56. <if test="ruleName != null and ruleName != ''">
  57. and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
  58. </if>
  59. </where>
  60. </select>
  61. <select id="queryScoringRulesByRuleName" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
  62. select rules_id,rule_name
  63. from simulation.scoring_rules
  64. <where>
  65. is_deleted = '0'
  66. <if test="rulesId != null and rulesId != ''">
  67. and rules_id != #{rulesId}
  68. </if>
  69. <if test="ruleName != null and ruleName != ''">
  70. and rule_name =#{ruleName}
  71. </if>
  72. <if test="createUserId != null and createUserId != ''">
  73. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  74. </if>
  75. <if test="share != null and share != ''">
  76. and share=#{share,jdbcType=VARCHAR}
  77. </if>
  78. </where>
  79. </select>
  80. <update id="updateScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
  81. update simulation.scoring_rules
  82. <set>
  83. <if test="isDeleted != null and isDeleted!=''">
  84. is_deleted = #{isDeleted,jdbcType=VARCHAR},
  85. </if>
  86. <if test="share != null and share!=''">
  87. share = #{share,jdbcType=VARCHAR},
  88. </if>
  89. <if test="ruleName != null and ruleName!=''">
  90. rule_name = #{ruleName,jdbcType=VARCHAR},
  91. </if>
  92. <if test="ruleDescription != null and ruleDescription!=''">
  93. rule_description = #{ruleDescription,jdbcType=VARCHAR},
  94. </if>
  95. <if test="ruleDetails != null and ruleDetails!=''">
  96. rule_details = #{ruleDetails,jdbcType=VARCHAR},
  97. </if>
  98. <if test="modifyUserId != null and modifyUserId!=''">
  99. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  100. </if>
  101. <if test="modifyTime != null">
  102. modify_time = #{modifyTime},
  103. </if>
  104. </set>
  105. where rules_id = #{rulesId,jdbcType=VARCHAR}
  106. </update>
  107. <update id="deleteScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
  108. update simulation.scoring_rules
  109. <set>
  110. <if test="isDeleted != null and isDeleted!=''">
  111. is_deleted = #{isDeleted,jdbcType=VARCHAR},
  112. </if>
  113. <if test="modifyUserId != null and modifyUserId!=''">
  114. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  115. </if>
  116. <if test="modifyTime != null">
  117. modify_time = #{modifyTime},
  118. </if>
  119. </set>
  120. where rules_id = #{rulesId,jdbcType=VARCHAR}
  121. </update>
  122. </mapper>