CcGatewaysMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.cc.mapper.CcGatewaysMapper">
  6. <resultMap type="CcGateways" id="CcGatewaysResult">
  7. <result property="id" column="id" />
  8. <result property="gwName" column="gw_name" />
  9. <result property="profileName" column="profile_name" />
  10. <result property="caller" column="caller" />
  11. <result property="calleePrefix" column="callee_prefix" />
  12. <result property="gwAddr" column="gw_addr" />
  13. <result property="codec" column="codec" />
  14. <result property="gwDesc" column="gw_desc" />
  15. <result property="maxConcurrency" column="max_concurrency" />
  16. <result property="authUsername" column="auth_username" />
  17. <result property="authPassword" column="auth_password" />
  18. <result property="priority" column="priority" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="register" column="register" />
  21. <result property="configs" column="configs" />
  22. <result property="purpose" column="purpose" />
  23. </resultMap>
  24. <sql id="selectCcGatewaysVo">
  25. select id, gw_name, profile_name, caller, callee_prefix, gw_addr, codec, gw_desc, max_concurrency, auth_username, auth_password, priority, update_time, register, configs, purpose from cc_gateways
  26. </sql>
  27. <select id="selectCcGatewaysList" parameterType="CcGateways" resultMap="CcGatewaysResult">
  28. <include refid="selectCcGatewaysVo"/>
  29. <where>
  30. <if test="gwName != null and gwName != ''"> and gw_name = #{gwName}</if>
  31. <if test="profileName != null and profileName != ''"> and profile_name = #{profileName}</if>
  32. <if test="caller != null and caller != ''"> and caller = #{caller}</if>
  33. <if test="calleePrefix != null and calleePrefix != ''"> and callee_prefix = #{calleePrefix}</if>
  34. <if test="gwAddr != null and gwAddr != ''"> and gw_addr = #{gwAddr}</if>
  35. <if test="codec != null and codec != ''"> and codec = #{codec}</if>
  36. <if test="gwDesc != null and gwDesc != ''"> and gw_desc like concat('%', #{gwDesc}, '%')</if>
  37. <if test="maxConcurrency != null "> and max_concurrency = #{maxConcurrency}</if>
  38. <if test="authUsername != null and authUsername != ''"> and auth_username like concat('%', #{authUsername}, '%')</if>
  39. <if test="authPassword != null and authPassword != ''"> and auth_password = #{authPassword}</if>
  40. <if test="priority != null "> and priority = #{priority}</if>
  41. <if test="register != null "> and register = #{register}</if>
  42. <if test="purpose != null "> and purpose = #{purpose}</if>
  43. <if test="params.purposes != null and !params.purposes.isEmpty()">
  44. and purpose in
  45. <foreach item="purpose" collection="params.purposes" open="(" separator="," close=")">
  46. #{purpose}
  47. </foreach>
  48. </if>
  49. </where>
  50. </select>
  51. <select id="selectCcGatewaysById" parameterType="Long" resultMap="CcGatewaysResult">
  52. <include refid="selectCcGatewaysVo"/>
  53. where id = #{id}
  54. </select>
  55. <insert id="insertCcGateways" parameterType="CcGateways" useGeneratedKeys="true" keyProperty="id">
  56. insert into cc_gateways
  57. <trim prefix="(" suffix=")" suffixOverrides=",">
  58. gw_name,
  59. profile_name,
  60. caller,
  61. callee_prefix,
  62. gw_addr,
  63. codec,
  64. gw_desc,
  65. max_concurrency,
  66. auth_username,
  67. auth_password,
  68. priority,
  69. update_time,
  70. register,
  71. configs,
  72. purpose,
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. #{gwName},
  76. #{profileName},
  77. #{caller},
  78. #{calleePrefix},
  79. #{gwAddr},
  80. #{codec},
  81. #{gwDesc},
  82. #{maxConcurrency},
  83. #{authUsername},
  84. #{authPassword},
  85. #{priority},
  86. #{updateTime},
  87. #{register},
  88. #{configs},
  89. #{purpose},
  90. </trim>
  91. </insert>
  92. <update id="updateCcGateways" parameterType="CcGateways">
  93. update cc_gateways
  94. <trim prefix="SET" suffixOverrides=",">
  95. gw_name = #{gwName},
  96. profile_name = #{profileName},
  97. caller = #{caller},
  98. callee_prefix = #{calleePrefix},
  99. gw_desc = #{gwDesc},
  100. codec = #{codec},
  101. gw_addr = #{gwAddr},
  102. max_concurrency = #{maxConcurrency},
  103. auth_username = #{authUsername},
  104. auth_password = #{authPassword},
  105. priority = #{priority},
  106. update_time = #{updateTime},
  107. register = #{register},
  108. configs = #{configs},
  109. purpose = #{purpose},
  110. </trim>
  111. where id = #{id}
  112. </update>
  113. <delete id="deleteCcGatewaysById" parameterType="Long">
  114. delete from cc_gateways where id = #{id}
  115. </delete>
  116. <delete id="deleteCcGatewaysByIds" parameterType="String">
  117. delete from cc_gateways where id in
  118. <foreach item="id" collection="array" open="(" separator="," close=")">
  119. #{id}
  120. </foreach>
  121. </delete>
  122. </mapper>