ReceptionPersonnelMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.system.mapper.ReceptionPersonnelMapper">
  6. <resultMap type="ReceptionPersonnel" id="ReceptionPersonnelResult">
  7. <result property="receptionId" column="reception_id" />
  8. <result property="receptionName" column="reception_name" />
  9. <result property="phonenumber" column="phonenumber" />
  10. <result property="introduction" column="introduction" />
  11. <result property="avatar" column="avatar" />
  12. <result property="status" column="status" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="remark" column="remark" />
  18. </resultMap>
  19. <sql id="selectReceptionPersonnelVo">
  20. select reception_id, reception_name, phonenumber, introduction, avatar, status, create_by, create_time, update_by, update_time, remark from reception_personnel
  21. </sql>
  22. <select id="selectReceptionPersonnelList" parameterType="ReceptionPersonnel" resultMap="ReceptionPersonnelResult">
  23. <include refid="selectReceptionPersonnelVo"/>
  24. <where>
  25. <if test="receptionName != null and receptionName != ''"> and reception_name like concat('%', #{receptionName}, '%')</if>
  26. <if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
  27. <if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
  28. <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
  29. <if test="status != null and status != ''"> and status = #{status}</if>
  30. </where>
  31. order by create_time DESC
  32. </select>
  33. <select id="selectReceptionPersonnelByReceptionId" parameterType="Long" resultMap="ReceptionPersonnelResult">
  34. <include refid="selectReceptionPersonnelVo"/>
  35. where reception_id = #{receptionId}
  36. </select>
  37. <select id="selectReceptionPersonnelCount" resultType="java.lang.Integer">
  38. select count(1) from reception_personnel
  39. </select>
  40. <insert id="insertReceptionPersonnel" parameterType="ReceptionPersonnel" useGeneratedKeys="true" keyProperty="receptionId">
  41. insert into reception_personnel
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="receptionName != null and receptionName != ''">reception_name,</if>
  44. <if test="phonenumber != null">phonenumber,</if>
  45. <if test="introduction != null">introduction,</if>
  46. <if test="avatar != null">avatar,</if>
  47. <if test="status != null">status,</if>
  48. <if test="createBy != null">create_by,</if>
  49. <if test="createTime != null">create_time,</if>
  50. <if test="updateBy != null">update_by,</if>
  51. <if test="updateTime != null">update_time,</if>
  52. <if test="remark != null">remark,</if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="receptionName != null and receptionName != ''">#{receptionName},</if>
  56. <if test="phonenumber != null">#{phonenumber},</if>
  57. <if test="introduction != null">#{introduction},</if>
  58. <if test="avatar != null">#{avatar},</if>
  59. <if test="status != null">#{status},</if>
  60. <if test="createBy != null">#{createBy},</if>
  61. <if test="createTime != null">#{createTime},</if>
  62. <if test="updateBy != null">#{updateBy},</if>
  63. <if test="updateTime != null">#{updateTime},</if>
  64. <if test="remark != null">#{remark},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateReceptionPersonnel" parameterType="ReceptionPersonnel">
  68. update reception_personnel
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="receptionName != null and receptionName != ''">reception_name = #{receptionName},</if>
  71. <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
  72. <if test="introduction != null">introduction = #{introduction},</if>
  73. <if test="avatar != null">avatar = #{avatar},</if>
  74. <if test="status != null">status = #{status},</if>
  75. <if test="createBy != null">create_by = #{createBy},</if>
  76. <if test="createTime != null">create_time = #{createTime},</if>
  77. <if test="updateBy != null">update_by = #{updateBy},</if>
  78. <if test="updateTime != null">update_time = #{updateTime},</if>
  79. <if test="remark != null">remark = #{remark},</if>
  80. </trim>
  81. where reception_id = #{receptionId}
  82. </update>
  83. <delete id="deleteReceptionPersonnelByReceptionId" parameterType="Long">
  84. delete from reception_personnel where reception_id = #{receptionId}
  85. </delete>
  86. <delete id="deleteReceptionPersonnelByReceptionIds" parameterType="String">
  87. delete from reception_personnel where reception_id in
  88. <foreach item="receptionId" collection="array" open="(" separator="," close=")">
  89. #{receptionId}
  90. </foreach>
  91. </delete>
  92. </mapper>