BusiAgentsLocationMapper.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.voluntary.mapper.BusiAgentsLocationMapper">
  6. <resultMap type="BusiAgentsLocation" id="BusiAgentsLocationResult">
  7. <result property="id" column="id" />
  8. <result property="agentId" column="agent_id" />
  9. <result property="pro" column="pro" />
  10. <result property="city" column="city" />
  11. <result property="area" column="area" />
  12. <result property="level" column="level" />
  13. <result property="status" column="status" />
  14. <result property="createTime" column="create_time" />
  15. </resultMap>
  16. <sql id="selectBusiAgentsLocationVo">
  17. select id, agent_id, pro, city, area, level, status, create_time from b_busi_agents_location
  18. </sql>
  19. <select id="selectBusiAgentsLocationList" parameterType="BusiAgentsLocation" resultMap="BusiAgentsLocationResult">
  20. <include refid="selectBusiAgentsLocationVo"/>
  21. <where>
  22. <if test="agentId != null "> and agent_id = #{agentId}</if>
  23. <if test="pro != null "> and pro = #{pro}</if>
  24. <if test="city != null "> and city = #{city}</if>
  25. <if test="area != null "> and area = #{area}</if>
  26. <if test="level != null "> and level = #{level}</if>
  27. <if test="status != null "> and status = #{status}</if>
  28. </where>
  29. order by id desc
  30. </select>
  31. <select id="selectBusiAgentsLocationById" parameterType="Long" resultMap="BusiAgentsLocationResult">
  32. <include refid="selectBusiAgentsLocationVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertBusiAgentsLocation" parameterType="BusiAgentsLocation" useGeneratedKeys="true" keyProperty="id">
  36. insert into b_busi_agents_location
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="agentId != null">agent_id,</if>
  39. <if test="pro != null">pro,</if>
  40. <if test="city != null">city,</if>
  41. <if test="area != null">area,</if>
  42. <if test="level != null">level,</if>
  43. <if test="status != null">status,</if>
  44. <if test="createTime != null">create_time,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="agentId != null">#{agentId},</if>
  48. <if test="pro != null">#{pro},</if>
  49. <if test="city != null">#{city},</if>
  50. <if test="area != null">#{area},</if>
  51. <if test="level != null">#{level},</if>
  52. <if test="status != null">#{status},</if>
  53. <if test="createTime != null">#{createTime},</if>
  54. </trim>
  55. </insert>
  56. <update id="updateBusiAgentsLocation" parameterType="BusiAgentsLocation">
  57. update b_busi_agents_location
  58. <trim prefix="SET" suffixOverrides=",">
  59. <if test="agentId != null">agent_id = #{agentId},</if>
  60. <if test="pro != null">pro = #{pro},</if>
  61. <if test="city != null">city = #{city},</if>
  62. <if test="area != null">area = #{area},</if>
  63. <if test="level != null">level = #{level},</if>
  64. <if test="status != null">status = #{status},</if>
  65. <if test="createTime != null">create_time = #{createTime},</if>
  66. </trim>
  67. where id = #{id}
  68. </update>
  69. <delete id="deleteBusiAgentsLocationById" parameterType="Long">
  70. delete from b_busi_agents_location where id = #{id}
  71. </delete>
  72. <delete id="deleteBusiAgentsLocationByIds" parameterType="String">
  73. delete from b_busi_agents_location where id in
  74. <foreach item="id" collection="array" open="(" separator="," close=")">
  75. #{id}
  76. </foreach>
  77. </delete>
  78. </mapper>