SysDictItemMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.middle.platform.system.biz.mapper.SysDictItemMapper">
  4. <resultMap id="BaseResultMap" type="com.middle.platform.system.biz.entity.SysDictItem">
  5. <!--@mbg.generated-->
  6. <!--@Table sys_dict_item-->
  7. <id column="id" jdbcType="BIGINT" property="id"/>
  8. <result column="dict_id" jdbcType="BIGINT" property="dictId"/>
  9. <result column="value" jdbcType="VARCHAR" property="value"/>
  10. <result column="label" jdbcType="VARCHAR" property="label"/>
  11. <result column="type" jdbcType="VARCHAR" property="type"/>
  12. <result column="desc" jdbcType="VARCHAR" property="desc"/>
  13. <result column="sort" jdbcType="INTEGER" property="sort"/>
  14. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  16. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  17. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  18. <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime"/>
  19. <result column="del_flag" jdbcType="BOOLEAN" property="delFlag"/>
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. <!--@mbg.generated-->
  23. id,
  24. dict_id,
  25. `value`,
  26. `label`,
  27. `type`,
  28. `desc`,
  29. sort,
  30. create_by,
  31. create_time,
  32. update_by,
  33. update_time,
  34. delete_time,
  35. del_flag
  36. </sql>
  37. <select id="queryOne" resultType="com.middle.platform.system.api.pojo.DictCache">
  38. select *
  39. from sys_dict_item sdi
  40. <where>
  41. <if test="dictType != null and dictType != ''">
  42. and sdi.type = #{dictType,jdbcType=VARCHAR}
  43. </if>
  44. <if test="value != null and value != ''">
  45. and sdi.value = #{value,jdbcType=VARCHAR}
  46. </if>
  47. and sdi.del_flag = 0
  48. limit 1
  49. </where>
  50. </select>
  51. <select id="queryList" resultType="com.middle.platform.system.api.pojo.DictCache">
  52. select *
  53. from sys_dict_item sdi
  54. <where>
  55. <if test="dictType != null and dictType != ''">
  56. and sdi.type = #{dictType,jdbcType=VARCHAR}
  57. </if>
  58. and sdi.del_flag = 0
  59. </where>
  60. </select>
  61. <!-- 根据ID删除 -->
  62. <update id="delete">
  63. update sys_dict_item set del_flag = 1 where id = #{id,jdbcType=BIGINT}
  64. </update>
  65. <select id="getById" resultMap="BaseResultMap">
  66. select *
  67. from sys_dict_item sdi
  68. where del_flag = 0
  69. and id = #{id,jdbcType=BIGINT}
  70. </select>
  71. <update id="update">
  72. update sys_dict_item
  73. <set>
  74. <if test="dictId != null">
  75. `dict_id` = #{dictId,jdbcType=BIGINT},
  76. </if>
  77. <if test="value != null">
  78. `value` = #{value,jdbcType=VARCHAR},
  79. </if>
  80. <if test="label != null">
  81. `label` = #{label,jdbcType=VARCHAR},
  82. </if>
  83. <if test="type != null">
  84. `type` = #{type,jdbcType=VARCHAR},
  85. </if>
  86. <if test="desc != null">
  87. `desc` = #{desc,jdbcType=VARCHAR},
  88. </if>
  89. <if test="sort != null">
  90. `sort` = #{sort,jdbcType=INTEGER}
  91. </if>
  92. </set>
  93. <where>
  94. id = #{id,jdbcType=BIGINT}
  95. </where>
  96. </update>
  97. </mapper>