PdmScoreRankManagerMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.powerdistribution.mapper.PdmScoreRankManagerMapper">
  6. <resultMap type="PdmScoreRankManager" id="PdmScoreRankManagerResult">
  7. <result property="id" column="id" />
  8. <result property="reportYear" column="report_year" />
  9. <result property="reportDate" column="report_date" />
  10. <result property="companyNo" column="company_no" />
  11. <result property="companyName" column="company_name" />
  12. <result property="managerId" column="manager_id" />
  13. <result property="managerName" column="manager_name" />
  14. <result property="score" column="score" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. </resultMap>
  20. <sql id="selectPdmScoreRankManagerVo">
  21. select id, report_year, report_date, company_no, company_name, manager_id, manager_name, score, create_by, create_time, update_by, update_time from pdm_score_rank_manager
  22. </sql>
  23. <select id="selectPdmScoreRankManagerList" parameterType="PdmScoreRankManager" resultMap="PdmScoreRankManagerResult">
  24. <include refid="selectPdmScoreRankManagerVo"/>
  25. <where>
  26. <if test="reportYear != null and reportYear != ''"> and report_year = #{reportYear}</if>
  27. <if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
  28. <if test="companyNo != null and companyNo != ''"> and company_no = #{companyNo}</if>
  29. <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
  30. <if test="managerId != null and managerId != ''"> and manager_id = #{managerId}</if>
  31. <if test="managerName != null and managerName != ''"> and manager_name like concat('%', #{managerName}, '%')</if>
  32. <if test="score != null "> and score = #{score}</if>
  33. </where>
  34. <if test="isBlack == null or isBlack == '' ">
  35. order by score desc
  36. </if>
  37. <if test="isBlack !=null and isBlack == 1 ">
  38. order by score asc
  39. </if>
  40. </select>
  41. <select id="selectPdmScoreRankManagerById" parameterType="Long" resultMap="PdmScoreRankManagerResult">
  42. <include refid="selectPdmScoreRankManagerVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertPdmScoreRankManager" parameterType="PdmScoreRankManager" useGeneratedKeys="true" keyProperty="id">
  46. insert into pdm_score_rank_manager
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="reportYear != null">report_year,</if>
  49. <if test="reportDate != null">report_date,</if>
  50. <if test="companyNo != null">company_no,</if>
  51. <if test="companyName != null">company_name,</if>
  52. <if test="managerId != null">manager_id,</if>
  53. <if test="managerName != null">manager_name,</if>
  54. <if test="score != null">score,</if>
  55. <if test="createBy != null">create_by,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="updateBy != null">update_by,</if>
  58. <if test="updateTime != null">update_time,</if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="reportYear != null">#{reportYear},</if>
  62. <if test="reportDate != null">#{reportDate},</if>
  63. <if test="companyNo != null">#{companyNo},</if>
  64. <if test="companyName != null">#{companyName},</if>
  65. <if test="managerId != null">#{managerId},</if>
  66. <if test="managerName != null">#{managerName},</if>
  67. <if test="score != null">#{score},</if>
  68. <if test="createBy != null">#{createBy},</if>
  69. <if test="createTime != null">#{createTime},</if>
  70. <if test="updateBy != null">#{updateBy},</if>
  71. <if test="updateTime != null">#{updateTime},</if>
  72. </trim>
  73. </insert>
  74. <update id="updatePdmScoreRankManager" parameterType="PdmScoreRankManager">
  75. update pdm_score_rank_manager
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="reportYear != null">report_year = #{reportYear},</if>
  78. <if test="reportDate != null">report_date = #{reportDate},</if>
  79. <if test="companyNo != null">company_no = #{companyNo},</if>
  80. <if test="companyName != null">company_name = #{companyName},</if>
  81. <if test="managerId != null">manager_id = #{managerId},</if>
  82. <if test="managerName != null">manager_name = #{managerName},</if>
  83. <if test="score != null">score = #{score},</if>
  84. <if test="createBy != null">create_by = #{createBy},</if>
  85. <if test="createTime != null">create_time = #{createTime},</if>
  86. <if test="updateBy != null">update_by = #{updateBy},</if>
  87. <if test="updateTime != null">update_time = #{updateTime},</if>
  88. </trim>
  89. where id = #{id}
  90. </update>
  91. <delete id="deletePdmScoreRankManagerById" parameterType="Long">
  92. delete from pdm_score_rank_manager where id = #{id}
  93. </delete>
  94. <delete id="deletePdmScoreRankManagerByIds" parameterType="String">
  95. delete from pdm_score_rank_manager where id in
  96. <foreach item="id" collection="array" open="(" separator="," close=")">
  97. #{id}
  98. </foreach>
  99. </delete>
  100. </mapper>