SystemConfigMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.jeeplus.modules.sys.mapper.SystemConfigMapper">
  4. <sql id="systemConfigColumns">
  5. a.id AS "id",
  6. a.smtp AS "smtp",
  7. a.port AS "port",
  8. a.mailname AS "mailName",
  9. a.mailpassword AS "mailPassword",
  10. a.smsname AS "smsName",
  11. a.smspassword AS "smsPassword"
  12. </sql>
  13. <sql id="systemConfigJoins">
  14. </sql>
  15. <select id="get" resultType="SystemConfig">
  16. SELECT
  17. <include refid="systemConfigColumns"/>
  18. FROM sys_config a
  19. <include refid="systemConfigJoins"/>
  20. WHERE a.id = #{id}
  21. </select>
  22. <select id="findList" resultType="SystemConfig">
  23. SELECT
  24. <include refid="systemConfigColumns"/>
  25. FROM sys_config a
  26. <include refid="systemConfigJoins"/>
  27. <where>
  28. </where>
  29. <choose>
  30. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  31. ORDER BY ${page.orderBy}
  32. </when>
  33. <otherwise>
  34. </otherwise>
  35. </choose>
  36. </select>
  37. <select id="findAllList" resultType="SystemConfig">
  38. SELECT
  39. <include refid="systemConfigColumns"/>
  40. FROM sys_config a
  41. <include refid="systemConfigJoins"/>
  42. <where>
  43. </where>
  44. <choose>
  45. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  46. ORDER BY ${page.orderBy}
  47. </when>
  48. <otherwise>
  49. </otherwise>
  50. </choose>
  51. </select>
  52. <insert id="insert">
  53. INSERT INTO sys_config(
  54. id,
  55. smtp,
  56. port,
  57. mailname,
  58. mailpassword,
  59. smsname,
  60. smspassword
  61. ) VALUES (
  62. #{id},
  63. #{smtp},
  64. #{port},
  65. #{mailName},
  66. #{mailPassword},
  67. #{smsName},
  68. #{smsPassword}
  69. )
  70. </insert>
  71. <update id="update">
  72. UPDATE sys_config SET
  73. smtp = #{smtp},
  74. port = #{port},
  75. mailname = #{mailName},
  76. mailpassword = #{mailPassword},
  77. smsname = #{smsName},
  78. smspassword = #{smsPassword}
  79. WHERE id = #{id}
  80. </update>
  81. <!--物理删除-->
  82. <update id="delete">
  83. DELETE FROM sys_config
  84. WHERE id = #{id}
  85. </update>
  86. <!--逻辑删除-->
  87. <update id="deleteByLogic">
  88. UPDATE sys_config SET
  89. del_flag = #{DEL_FLAG_DELETE}
  90. WHERE id = #{id}
  91. </update>
  92. <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
  93. <select id="findUniqueByProperty" resultType="SystemConfig" statementType="STATEMENT">
  94. select * FROM sys_config where ${propertyName} = '${value}'
  95. </select>
  96. </mapper>