HospitalOperLogMapper.xml 7.4 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.fs.hospital.mapper.HospitalOperLogMapper">
  6. <resultMap type="HospitalOperLog" id="HospitalOperLogResult">
  7. <result property="operId" column="oper_id" />
  8. <result property="title" column="title" />
  9. <result property="businessType" column="business_type" />
  10. <result property="method" column="method" />
  11. <result property="requestMethod" column="request_method" />
  12. <result property="operatorType" column="operator_type" />
  13. <result property="operName" column="oper_name" />
  14. <result property="deptName" column="dept_name" />
  15. <result property="operUrl" column="oper_url" />
  16. <result property="operIp" column="oper_ip" />
  17. <result property="operLocation" column="oper_location" />
  18. <result property="operParam" column="oper_param" />
  19. <result property="jsonResult" column="json_result" />
  20. <result property="status" column="status" />
  21. <result property="errorMsg" column="error_msg" />
  22. <result property="operTime" column="oper_time" />
  23. <result property="hospitalId" column="hospital_id" />
  24. </resultMap>
  25. <sql id="selectHospitalOperLogVo">
  26. select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, hospital_id from hospital_oper_log
  27. </sql>
  28. <select id="selectHospitalOperLogList" parameterType="HospitalOperLog" resultMap="HospitalOperLogResult">
  29. <include refid="selectHospitalOperLogVo"/>
  30. <where>
  31. <if test="title != null and title != ''"> and title = #{title}</if>
  32. <if test="businessType != null "> and business_type = #{businessType}</if>
  33. <if test="method != null and method != ''"> and method = #{method}</if>
  34. <if test="requestMethod != null and requestMethod != ''"> and request_method = #{requestMethod}</if>
  35. <if test="operatorType != null "> and operator_type = #{operatorType}</if>
  36. <if test="operName != null and operName != ''"> and oper_name like concat('%', #{operName}, '%')</if>
  37. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  38. <if test="operUrl != null and operUrl != ''"> and oper_url = #{operUrl}</if>
  39. <if test="operIp != null and operIp != ''"> and oper_ip = #{operIp}</if>
  40. <if test="operLocation != null and operLocation != ''"> and oper_location = #{operLocation}</if>
  41. <if test="operParam != null and operParam != ''"> and oper_param = #{operParam}</if>
  42. <if test="jsonResult != null and jsonResult != ''"> and json_result = #{jsonResult}</if>
  43. <if test="status != null "> and status = #{status}</if>
  44. <if test="errorMsg != null and errorMsg != ''"> and error_msg = #{errorMsg}</if>
  45. <if test="operTime != null "> and oper_time = #{operTime}</if>
  46. <if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
  47. </where>
  48. </select>
  49. <select id="selectHospitalOperLogByOperId" parameterType="Long" resultMap="HospitalOperLogResult">
  50. <include refid="selectHospitalOperLogVo"/>
  51. where oper_id = #{operId}
  52. </select>
  53. <insert id="insertHospitalOperLog" parameterType="HospitalOperLog" useGeneratedKeys="true" keyProperty="operId">
  54. insert into hospital_oper_log
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="title != null">title,</if>
  57. <if test="businessType != null">business_type,</if>
  58. <if test="method != null">method,</if>
  59. <if test="requestMethod != null">request_method,</if>
  60. <if test="operatorType != null">operator_type,</if>
  61. <if test="operName != null">oper_name,</if>
  62. <if test="deptName != null">dept_name,</if>
  63. <if test="operUrl != null">oper_url,</if>
  64. <if test="operIp != null">oper_ip,</if>
  65. <if test="operLocation != null">oper_location,</if>
  66. <if test="operParam != null">oper_param,</if>
  67. <if test="jsonResult != null">json_result,</if>
  68. <if test="status != null">status,</if>
  69. <if test="errorMsg != null">error_msg,</if>
  70. <if test="operTime != null">oper_time,</if>
  71. <if test="hospitalId != null">hospital_id,</if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides=",">
  74. <if test="title != null">#{title},</if>
  75. <if test="businessType != null">#{businessType},</if>
  76. <if test="method != null">#{method},</if>
  77. <if test="requestMethod != null">#{requestMethod},</if>
  78. <if test="operatorType != null">#{operatorType},</if>
  79. <if test="operName != null">#{operName},</if>
  80. <if test="deptName != null">#{deptName},</if>
  81. <if test="operUrl != null">#{operUrl},</if>
  82. <if test="operIp != null">#{operIp},</if>
  83. <if test="operLocation != null">#{operLocation},</if>
  84. <if test="operParam != null">#{operParam},</if>
  85. <if test="jsonResult != null">#{jsonResult},</if>
  86. <if test="status != null">#{status},</if>
  87. <if test="errorMsg != null">#{errorMsg},</if>
  88. <if test="operTime != null">#{operTime},</if>
  89. <if test="hospitalId != null">#{hospitalId},</if>
  90. </trim>
  91. </insert>
  92. <update id="updateHospitalOperLog" parameterType="HospitalOperLog">
  93. update hospital_oper_log
  94. <trim prefix="SET" suffixOverrides=",">
  95. <if test="title != null">title = #{title},</if>
  96. <if test="businessType != null">business_type = #{businessType},</if>
  97. <if test="method != null">method = #{method},</if>
  98. <if test="requestMethod != null">request_method = #{requestMethod},</if>
  99. <if test="operatorType != null">operator_type = #{operatorType},</if>
  100. <if test="operName != null">oper_name = #{operName},</if>
  101. <if test="deptName != null">dept_name = #{deptName},</if>
  102. <if test="operUrl != null">oper_url = #{operUrl},</if>
  103. <if test="operIp != null">oper_ip = #{operIp},</if>
  104. <if test="operLocation != null">oper_location = #{operLocation},</if>
  105. <if test="operParam != null">oper_param = #{operParam},</if>
  106. <if test="jsonResult != null">json_result = #{jsonResult},</if>
  107. <if test="status != null">status = #{status},</if>
  108. <if test="errorMsg != null">error_msg = #{errorMsg},</if>
  109. <if test="operTime != null">oper_time = #{operTime},</if>
  110. <if test="hospitalId != null">hospital_id = #{hospitalId},</if>
  111. </trim>
  112. where oper_id = #{operId}
  113. </update>
  114. <delete id="deleteHospitalOperLogByOperId" parameterType="Long">
  115. delete from hospital_oper_log where oper_id = #{operId}
  116. </delete>
  117. <delete id="deleteHospitalOperLogByOperIds" parameterType="String">
  118. delete from hospital_oper_log where oper_id in
  119. <foreach item="operId" collection="array" open="(" separator="," close=")">
  120. #{operId}
  121. </foreach>
  122. </delete>
  123. </mapper>