<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.jilinsscgsdp.keyPersonRatingLevel" name="评分等级划分设置">
  <select id="selectRatingLevelList" resultType="java.util.HashMap">
    SELECT
      id,
      rating_dict_type,
      rating_start_score,
      rating_end_score,
      rating_level_value,
      rating_level_label,
      create_by,
      create_time,
      update_by,
      update_time
    FROM jl_key_person_rating_dict_level
    WHERE rating_dict_type = #{rating_dict_type}
    ORDER BY CAST(rating_start_score AS SIGNED) ASC
  </select>

  <delete id="deleteByType">
    DELETE FROM jl_key_person_rating_dict_level WHERE rating_dict_type = #{rating_dict_type}
  </delete>

  <insert id="insert">
    INSERT INTO jl_key_person_rating_dict_level (
      id,
      rating_dict_type,
      rating_start_score,
      rating_end_score,
      rating_level_value,
      rating_level_label,
      create_by,
      create_time,
      update_by,
      update_time
    ) VALUES (
      REPLACE(UUID(), '-', ''),
      #{rating_dict_type},
      #{rating_start_score},
      #{rating_end_score},
      #{rating_level_value},
      #{rating_level_label},
      #{_user.id},
      NOW(),
      #{_user.id},
      NOW()
    )
  </insert>
</mapper>
