123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <?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.css.simulation.resource.scene.mapper.ScoringRulesMapper" >
- <insert id="saveScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
- insert into simulation.scoring_rules
- (rules_id,rules_code,rule_name,rule_description,rule_details,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share)
- values (#{rulesId,jdbcType=VARCHAR},#{rulesCode,jdbcType=VARCHAR},#{ruleName,jdbcType=VARCHAR},#{ruleDescription,jdbcType=VARCHAR},#{ruleDetails},
- #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
- #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
- </insert>
- <select id="queryScoringRulesList" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
- select
- rules_id,rules_code,rule_name,rule_description,rule_details,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share
- from simulation.scoring_rules
- <where>
- is_deleted = '0'
- <if test="rulesId != null and rulesId != ''">
- and rules_id = #{rulesId,jdbcType=VARCHAR}
- </if>
- <if test="rulesCode != null and rulesCode != ''">
- and rules_code = #{rulesCode,jdbcType=VARCHAR}
- </if>
- <if test="share != null and share!=''">
- and share = #{share,jdbcType=VARCHAR}
- </if>
- <if test="ruleName != null and ruleName != ''">
- and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
- </if>
- <if test="ruleDescription != null and ruleDescription != ''">
- and rule_description like CONCAT('%',#{ruleDescription},'%')
- </if>
- <if test="yearMax != null and yearMax != ''">
- and #{yearMax,jdbcType=VARCHAR} > create_time and #{yearMin,jdbcType=VARCHAR} < create_time
- </if>
- <if test="createUserId != null and createUserId != ''">
- and create_user_id=#{createUserId,jdbcType=VARCHAR}
- </if>
- order by modify_time desc
- </where>
- </select>
- <select id="queryScoringRules" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
- select
- rules_id,rule_name,rule_description,rule_details,
- create_user_id,create_time,modify_user_id,modify_time,
- is_deleted,share
- from simulation.scoring_rules
- <where>
- is_deleted = '0'
- <if test="rulesId != null and rulesId != ''">
- and rules_id = #{rulesId,jdbcType=VARCHAR}
- </if>
- <if test="ruleName != null and ruleName != ''">
- and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
- </if>
- </where>
- </select>
- <select id="queryScoringRulesByRuleName" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
- select rules_id,rule_name
- from simulation.scoring_rules
- <where>
- is_deleted = '0'
- <if test="rulesId != null and rulesId != ''">
- and rules_id != #{rulesId}
- </if>
- <if test="ruleName != null and ruleName != ''">
- and rule_name =#{ruleName}
- </if>
- <if test="createUserId != null and createUserId != ''">
- and create_user_id=#{createUserId,jdbcType=VARCHAR}
- </if>
- <if test="share != null and share != ''">
- and share=#{share,jdbcType=VARCHAR}
- </if>
- </where>
- </select>
- <update id="updateScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
- update simulation.scoring_rules
- <set>
- <if test="isDeleted != null and isDeleted!=''">
- is_deleted = #{isDeleted,jdbcType=VARCHAR},
- </if>
- <if test="share != null and share!=''">
- share = #{share,jdbcType=VARCHAR},
- </if>
- <if test="ruleName != null and ruleName!=''">
- rule_name = #{ruleName,jdbcType=VARCHAR},
- </if>
- <if test="ruleDescription != null and ruleDescription!=''">
- rule_description = #{ruleDescription,jdbcType=VARCHAR},
- </if>
- <if test="ruleDetails != null and ruleDetails!=''">
- rule_details = #{ruleDetails,jdbcType=VARCHAR},
- </if>
- <if test="modifyUserId != null and modifyUserId!=''">
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null">
- modify_time = #{modifyTime},
- </if>
- </set>
- where rules_id = #{rulesId,jdbcType=VARCHAR}
- </update>
- <update id="deleteScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
- update simulation.scoring_rules
- <set>
- <if test="isDeleted != null and isDeleted!=''">
- is_deleted = #{isDeleted,jdbcType=VARCHAR},
- </if>
- <if test="modifyUserId != null and modifyUserId!=''">
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null">
- modify_time = #{modifyTime},
- </if>
- </set>
- where rules_id = #{rulesId,jdbcType=VARCHAR}
- </update>
- </mapper>
|