RobotOpsAppointmentRecordMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.base.mapper.RobotOpsAppointmentRecordMapper">
  6. <resultMap type="RobotOpsAppointmentRecord" id="RobotOpsAppointmentRecordResult">
  7. <result property="id" column="id" />
  8. <result property="appointmentNo" column="appointment_no" />
  9. <result property="visitorName" column="visitor_name" />
  10. <result property="mobile" column="mobile" />
  11. <result property="visitedPerson" column="visited_person" />
  12. <result property="appointmentTime" column="appointment_time" />
  13. <result property="status" column="status" />
  14. <result property="syncTime" column="sync_time" />
  15. <result property="sourcePlatform" column="source_platform" />
  16. <result property="remark" column="remark" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateTime" column="update_time" />
  19. </resultMap>
  20. <sql id="selectRobotOpsAppointmentRecordVo">
  21. select id, appointment_no, visitor_name, mobile, visited_person, appointment_time, status, sync_time, source_platform, remark, create_time, update_time from robot_ops_appointment_record
  22. </sql>
  23. <select id="selectRobotOpsAppointmentRecordList" parameterType="RobotOpsAppointmentRecord" resultMap="RobotOpsAppointmentRecordResult">
  24. <include refid="selectRobotOpsAppointmentRecordVo"/>
  25. <where>
  26. <if test="appointmentNo != null and appointmentNo != ''"> and appointment_no = #{appointmentNo}</if>
  27. <if test="visitorName != null and visitorName != ''"> and visitor_name like concat('%', #{visitorName}, '%')</if>
  28. <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
  29. <if test="visitedPerson != null and visitedPerson != ''"> and visited_person like concat('%', #{visitedPerson}, '%')</if>
  30. <if test="appointmentTime != null "> and appointment_time = #{appointmentTime}</if>
  31. <if test="status != null "> and status = #{status}</if>
  32. <if test="syncTime != null "> and sync_time = #{syncTime}</if>
  33. <if test="sourcePlatform != null and sourcePlatform != ''"> and source_platform = #{sourcePlatform}</if>
  34. <if test="params.beginTime != null and params.beginTime != ''">
  35. and date_format(appointment_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  36. </if>
  37. <if test="params.endTime != null and params.endTime != ''">
  38. and date_format(appointment_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  39. </if>
  40. </where>
  41. </select>
  42. <select id="selectRobotOpsAppointmentRecordById" parameterType="Long" resultMap="RobotOpsAppointmentRecordResult">
  43. <include refid="selectRobotOpsAppointmentRecordVo"/>
  44. where id = #{id}
  45. </select>
  46. <insert id="insertRobotOpsAppointmentRecord" parameterType="RobotOpsAppointmentRecord" useGeneratedKeys="true" keyProperty="id">
  47. insert into robot_ops_appointment_record
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="appointmentNo != null and appointmentNo != ''">appointment_no,</if>
  50. <if test="visitorName != null">visitor_name,</if>
  51. <if test="mobile != null">mobile,</if>
  52. <if test="visitedPerson != null">visited_person,</if>
  53. <if test="appointmentTime != null">appointment_time,</if>
  54. <if test="status != null">status,</if>
  55. <if test="syncTime != null">sync_time,</if>
  56. <if test="sourcePlatform != null">source_platform,</if>
  57. <if test="remark != null">remark,</if>
  58. <if test="createTime != null">create_time,</if>
  59. <if test="updateTime != null">update_time,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="appointmentNo != null and appointmentNo != ''">#{appointmentNo},</if>
  63. <if test="visitorName != null">#{visitorName},</if>
  64. <if test="mobile != null">#{mobile},</if>
  65. <if test="visitedPerson != null">#{visitedPerson},</if>
  66. <if test="appointmentTime != null">#{appointmentTime},</if>
  67. <if test="status != null">#{status},</if>
  68. <if test="syncTime != null">#{syncTime},</if>
  69. <if test="sourcePlatform != null">#{sourcePlatform},</if>
  70. <if test="remark != null">#{remark},</if>
  71. <if test="createTime != null">#{createTime},</if>
  72. <if test="updateTime != null">#{updateTime},</if>
  73. </trim>
  74. </insert>
  75. <update id="updateRobotOpsAppointmentRecord" parameterType="RobotOpsAppointmentRecord">
  76. update robot_ops_appointment_record
  77. <trim prefix="SET" suffixOverrides=",">
  78. <if test="appointmentNo != null and appointmentNo != ''">appointment_no = #{appointmentNo},</if>
  79. <if test="visitorName != null">visitor_name = #{visitorName},</if>
  80. <if test="mobile != null">mobile = #{mobile},</if>
  81. <if test="visitedPerson != null">visited_person = #{visitedPerson},</if>
  82. <if test="appointmentTime != null">appointment_time = #{appointmentTime},</if>
  83. <if test="status != null">status = #{status},</if>
  84. <if test="syncTime != null">sync_time = #{syncTime},</if>
  85. <if test="sourcePlatform != null">source_platform = #{sourcePlatform},</if>
  86. <if test="remark != null">remark = #{remark},</if>
  87. <if test="createTime != null">create_time = #{createTime},</if>
  88. <if test="updateTime != null">update_time = #{updateTime},</if>
  89. </trim>
  90. where id = #{id}
  91. </update>
  92. <delete id="deleteRobotOpsAppointmentRecordById" parameterType="Long">
  93. delete from robot_ops_appointment_record where id = #{id}
  94. </delete>
  95. <delete id="deleteRobotOpsAppointmentRecordByIds" parameterType="String">
  96. delete from robot_ops_appointment_record where id in
  97. <foreach item="id" collection="array" open="(" separator="," close=")">
  98. #{id}
  99. </foreach>
  100. </delete>
  101. </mapper>