ChannelMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.ytpm.dao.ChannelMapper">
  4. <insert id="insert">
  5. insert into yt_channel
  6. (
  7. channel_id,
  8. channel_name,
  9. login_type,
  10. channel_account,
  11. channel_pwd,
  12. channel_status,
  13. api_key,
  14. api_secret,
  15. remark,
  16. ad_platform_type
  17. )
  18. values
  19. (
  20. #{channelId},
  21. #{channelName},
  22. #{loginType},
  23. #{channelAccount},
  24. #{channelPwd},
  25. #{channelStatus},
  26. #{apiKey},
  27. #{apiSecret},
  28. #{remark},
  29. #{adPlatformType}
  30. )
  31. </insert>
  32. <update id="update">
  33. update yt_channel
  34. <set>
  35. <if test="channelName !=null">
  36. channel_name = #{channelName},
  37. </if>
  38. <if test="channelStatus !=null">
  39. channel_status = #{channelStatus},
  40. </if>
  41. <if test="apiKey !=null">
  42. api_key = #{apiKey},
  43. </if>
  44. <if test="apiSecret !=null">
  45. api_secret = #{apiSecret},
  46. </if>
  47. <if test="remark !=null">
  48. remark = #{remark},
  49. </if>
  50. <if test="enabled !=null">
  51. enabled = #{enabled},
  52. </if>
  53. <if test="adPlatformType !=null">
  54. ad_platform_type = #{adPlatformType},
  55. </if>
  56. <if test="channelAccount !=null">
  57. channel_account = #{channelAccount},
  58. </if>
  59. <if test="channelPwd !=null">
  60. channel_pwd = #{channelPwd},
  61. </if>
  62. <if test="loginType !=null">
  63. login_type = #{loginType},
  64. </if>
  65. <if test="networkId !=null">
  66. network_id=#{networkId}
  67. </if>
  68. </set>
  69. where channel_id = #{channelId}
  70. </update>
  71. <select id="channelList" resultType="com.ytpm.agent.view.AgentChannelView">
  72. select
  73. channel_id, channel_name, login_type, channel_account, channel_pwd, channel_status, api_key, api_secret, remark, enabled,ad_platform_type,network_id
  74. from yt_channel
  75. where enabled = 1
  76. </select>
  77. <select id="relativeChannel" resultType="com.ytpm.agent.view.AgentChannelView">
  78. select
  79. channel_id, channel_name, login_type, channel_account, channel_pwd, channel_status, api_key, api_secret, remark, enabled,ad_platform_type
  80. from yt_channel
  81. where enabled = 1 and channel_id not in (select channel_id from yt_app_channel_relative where app_id=#{appId})
  82. </select>
  83. </mapper>