TProjectChannelMapper.xml 6.8 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.invest.mapper.TProjectChannelMapper">
  6. <resultMap type="TProjectChannel" id="TProjectChannelResult">
  7. <result property="id" column="id" />
  8. <result property="channelName" column="channel_name" />
  9. <result property="channelCode" column="channel_code" />
  10. <result property="channelType" column="channel_type" />
  11. <result property="channelBlurb" column="channel_blurb" />
  12. <result property="contacts" column="contacts" />
  13. <result property="telephone" column="telephone" />
  14. <result property="address" column="address" />
  15. <result property="channelHead" column="channel_head" />
  16. <result property="status" column="status" />
  17. <result property="mark" column="mark" />
  18. <result property="delFlag" column="del_flag" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. </resultMap>
  24. <sql id="selectTProjectChannelVo">
  25. select id, channel_name, channel_code, channel_type, channel_blurb, contacts, telephone, address, channel_head, status, mark, del_flag, create_by, create_time, update_by, update_time from t_project_channel
  26. </sql>
  27. <select id="selectTProjectChannelList" parameterType="TProjectChannel" resultMap="TProjectChannelResult">
  28. <include refid="selectTProjectChannelVo"/>
  29. <where>
  30. del_flag = 0
  31. <if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
  32. <if test="channelCode != null and channelCode != ''"> and channel_code = #{channelCode}</if>
  33. <if test="channelType != null and channelType != ''"> and channel_type = #{channelType}</if>
  34. <if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
  35. <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
  36. <if test="channelHead != null and channelHead != ''"> and channel_head = #{channelHead}</if>
  37. <if test="status != null and status != ''"> and status = #{status}</if>
  38. </where>
  39. </select>
  40. <select id="selectTProjectChannelById" parameterType="String" resultMap="TProjectChannelResult">
  41. <include refid="selectTProjectChannelVo"/>
  42. where id = #{id}
  43. </select>
  44. <insert id="insertTProjectChannel" parameterType="TProjectChannel">
  45. insert into t_project_channel
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="id != null">id,</if>
  48. <if test="channelName != null">channel_name,</if>
  49. <if test="channelCode != null">channel_code,</if>
  50. <if test="channelType != null">channel_type,</if>
  51. <if test="channelBlurb != null">channel_blurb,</if>
  52. <if test="contacts != null">contacts,</if>
  53. <if test="telephone != null">telephone,</if>
  54. <if test="address != null">address,</if>
  55. <if test="channelHead != null">channel_head,</if>
  56. <if test="status != null">status,</if>
  57. <if test="mark != null">mark,</if>
  58. <if test="delFlag != null">del_flag,</if>
  59. <if test="createBy != null">create_by,</if>
  60. <if test="createTime != null">create_time,</if>
  61. <if test="updateBy != null">update_by,</if>
  62. <if test="updateTime != null">update_time,</if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="id != null">#{id},</if>
  66. <if test="channelName != null">#{channelName},</if>
  67. <if test="channelCode != null">#{channelCode},</if>
  68. <if test="channelType != null">#{channelType},</if>
  69. <if test="channelBlurb != null">#{channelBlurb},</if>
  70. <if test="contacts != null">#{contacts},</if>
  71. <if test="telephone != null">#{telephone},</if>
  72. <if test="address != null">#{address},</if>
  73. <if test="channelHead != null">#{channelHead},</if>
  74. <if test="status != null">#{status},</if>
  75. <if test="mark != null">#{mark},</if>
  76. <if test="delFlag != null">#{delFlag},</if>
  77. <if test="createBy != null">#{createBy},</if>
  78. <if test="createTime != null">#{createTime},</if>
  79. <if test="updateBy != null">#{updateBy},</if>
  80. <if test="updateTime != null">#{updateTime},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateTProjectChannel" parameterType="TProjectChannel">
  84. update t_project_channel
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="channelName != null">channel_name = #{channelName},</if>
  87. <if test="channelCode != null">channel_code = #{channelCode},</if>
  88. <if test="channelType != null">channel_type = #{channelType},</if>
  89. <if test="channelBlurb != null">channel_blurb = #{channelBlurb},</if>
  90. <if test="contacts != null">contacts = #{contacts},</if>
  91. <if test="telephone != null">telephone = #{telephone},</if>
  92. <if test="address != null">address = #{address},</if>
  93. <if test="channelHead != null">channel_head = #{channelHead},</if>
  94. <if test="status != null">status = #{status},</if>
  95. <if test="mark != null">mark = #{mark},</if>
  96. <if test="delFlag != null">del_flag = #{delFlag},</if>
  97. <if test="createBy != null">create_by = #{createBy},</if>
  98. <if test="createTime != null">create_time = #{createTime},</if>
  99. <if test="updateBy != null">update_by = #{updateBy},</if>
  100. <if test="updateTime != null">update_time = #{updateTime},</if>
  101. </trim>
  102. where id = #{id}
  103. </update>
  104. <delete id="deleteTProjectChannelById" parameterType="String">
  105. delete from t_project_channel where id = #{id}
  106. </delete>
  107. <delete id="deleteTProjectChannelByIds" parameterType="String">
  108. delete from t_project_channel where id in
  109. <foreach item="id" collection="array" open="(" separator="," close=")">
  110. #{id}
  111. </foreach>
  112. </delete>
  113. <update id="updateTProjectChannelByIds" parameterType="String">
  114. update t_project_channel
  115. set del_flag = 1
  116. where id in
  117. <foreach item="id" collection="array" open="(" separator="," close=")">
  118. #{id}
  119. </foreach>
  120. </update>
  121. </mapper>