ChannelInfoMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.fire.admin.mapper.ChannelInfoMapper">
  4. <resultMap id="channelInfoResultMap" type="com.fire.dto.ChannelInfo">
  5. <id column="channel_id" property="channelId"/>
  6. <result column="supplier_id" property="supplierId"/>
  7. <result column="supplier_name" property="supplierName"/>
  8. <result column="channel_name" property="channelName"/>
  9. <result column="operator" property="operator"/>
  10. <result column="is_valid" property="isValid"/>
  11. <result column="remark" property="remark"/>
  12. <result column="creator" property="creator"/>
  13. <result column="create_time" property="createTime"/>
  14. <result column="updator" property="updator"/>
  15. <result column="update_time" property="updateTime"/>
  16. <result column="ip" property="ip"/>
  17. <result column="discount" property="discount"/>
  18. <result column="channel_type" property="channelType"/>
  19. <result column="is_delete" property="isDelete"/>
  20. </resultMap>
  21. <sql id="common_field">
  22. aci.channel_id,
  23. aci.supplier_id,
  24. cs.supplier_name,
  25. aci.channel_name,
  26. aci.operator,
  27. aci.is_valid,
  28. aci.remark,
  29. aci.creator,
  30. aci.create_time,
  31. aci.updator,
  32. aci.update_time,
  33. aci.ip,
  34. aci.discount,
  35. aci.channel_type,
  36. aci.is_delete
  37. </sql>
  38. <select id="selectChannelInfoList" resultMap="channelInfoResultMap">
  39. SELECT
  40. <include refid="common_field"/>
  41. FROM access_channel_info AS aci LEFT JOIN channel_supplier AS cs
  42. ON aci.supplier_id = cs.supplier_id
  43. <where>
  44. <if test="channelId !=null">
  45. AND aci.channel_id = #{channelId}
  46. </if>
  47. <if test="supplierId !=null">
  48. AND aci.supplier_id = #{supplierId}
  49. </if>
  50. <if test="channelName !=null and channelName.trim()!=''">
  51. AND aci.channel_name LIKE CONCAT('%' #{channelName},'%')
  52. </if>
  53. AND aci.is_delete = 0
  54. </where>
  55. </select>
  56. <update id="delChannelById">
  57. UPDATE access_channel_info
  58. SET is_delete = 1
  59. WHERE channel_id = #{channelId}
  60. </update>
  61. </mapper>