SystemConfigMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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="net.lab1024.smartadmin.module.system.systemconfig.dao.SystemConfigDao">
  4. <resultMap id="systemConfigMap" type="net.lab1024.smartadmin.module.system.systemconfig.domain.entity.SystemConfigEntity"></resultMap>
  5. <select id="selectAll" resultMap="systemConfigMap">
  6. select * from t_system_config
  7. </select>
  8. <!-- 查询所有系统配置(分页) -->
  9. <select id="selectSystemSettingList" resultMap="systemConfigMap">
  10. SELECT
  11. id,
  12. config_name,
  13. config_key,
  14. config_value,
  15. config_group,
  16. is_using,
  17. remark,
  18. create_time,
  19. update_time
  20. FROM
  21. t_system_config
  22. <where>
  23. <if test="queryDTO.key != null and queryDTO.key != ''">
  24. <bind name="keyLike" value=" '%' + queryDTO.key +'%' "></bind>
  25. AND config_key LIKE #{keyLike}
  26. </if>
  27. <if test="queryDTO.configGroup != null and queryDTO.configGroup != ''">
  28. <bind name="configGroupLike" value=" '%' + queryDTO.configGroup +'%' "></bind>
  29. AND config_group like #{configGroupLike}
  30. </if>
  31. </where>
  32. </select>
  33. <select id="getListByGroup" resultMap="systemConfigMap">
  34. SELECT
  35. id,
  36. config_name,
  37. config_key,
  38. config_value,
  39. config_group,
  40. is_using,
  41. remark,
  42. create_time,
  43. update_time
  44. FROM
  45. t_system_config where config_group= #{group}
  46. </select>
  47. <!-- 根据key查询获取数据 -->
  48. <select id="getByKey" resultMap="systemConfigMap">
  49. SELECT
  50. id,
  51. config_name,
  52. config_key,
  53. config_value,
  54. config_group,
  55. is_using,
  56. remark,
  57. create_time,
  58. update_time
  59. FROM
  60. t_system_config
  61. WHERE
  62. config_key = #{key}
  63. </select>
  64. <select id="getByKeyExcludeId" resultMap="systemConfigMap">
  65. SELECT
  66. id,
  67. config_name,
  68. config_key,
  69. config_value,
  70. config_group,
  71. is_using,
  72. remark,
  73. create_time,
  74. update_time
  75. FROM
  76. t_system_config
  77. WHERE
  78. config_key = #{key} and id &lt;&gt; #{excludeId}
  79. </select>
  80. <select id="selectByKeyAndGroup" resultMap="systemConfigMap">
  81. SELECT
  82. id,
  83. config_name,
  84. config_key,
  85. config_value,
  86. config_group,
  87. is_using,
  88. remark,
  89. create_time,
  90. update_time
  91. FROM
  92. t_system_config
  93. WHERE config_group = #{group} AND config_key = #{configKey}
  94. </select>
  95. </mapper>