OperationalLogsMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.caimei.modules.user.dao.OperationsDao">
  4. <select id="findList" resultType="com.caimei.modules.user.entity.OperationalLogs">
  5. SELECT institutionName, Contact, operationtype, Actioncontent, Operator, Operationtime
  6. FROM `operational_logs`
  7. <where>
  8. <if test="institutionName != null and institutionName != ''">
  9. AND institutionName LIKE "%"#{institutionName}"%"
  10. </if>
  11. <if test="Contact != null and Contact != ''">
  12. AND Contact LIKE "%"#{Contact}"%"
  13. </if>
  14. <if test="operationtype != null and operationtype != ''">
  15. AND operationtype LIKE "%"#{operationtype}"%"
  16. </if>
  17. <if test="Operationtime != null and Operationtime != ''">
  18. AND Operationtime LIKE "%"#{Operationtime}"%"
  19. </if>
  20. <if test="startTime != null and startTime != ''">
  21. AND Operationtime <![CDATA[ > ]]> #{startTime}
  22. </if>
  23. <if test="endTime != null and endTime != ''">
  24. AND Operationtime <![CDATA[ < ]]> #{endTime}
  25. </if>
  26. </where>
  27. order by Operationtime desc
  28. <choose>
  29. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  30. ORDER BY ${page.orderBy}
  31. </when>
  32. </choose>
  33. </select>
  34. <insert id="insert" parameterType="com.caimei.modules.user.entity.OperationalLogs" keyProperty="id"
  35. useGeneratedKeys="true">
  36. INSERT INTO operational_logs
  37. (institutionName,
  38. Contact,
  39. operationtype,
  40. Actioncontent,
  41. Operator,
  42. Operationtime)
  43. VALUES (#{institutionName},
  44. #{Contact},
  45. #{operationtype},
  46. #{Actioncontent},
  47. #{Operator},
  48. #{Operationtime})
  49. </insert>
  50. <select id="ClubName" resultType="java.lang.String">
  51. SELECT a.linkMan FROM `club` a
  52. LEFT JOIN clubchangesprecord b ON a.clubid = b.clubid
  53. WHERE b.clubChangeSpRecordID = #{clubChangeSpRecordID}
  54. </select>
  55. <select id="ClubsName" resultType="java.lang.String">
  56. SELECT a.inviterName FROM `club` a
  57. LEFT JOIN clubchangesprecord b ON a.clubid = b.clubid
  58. WHERE b.clubChangeSpRecordID =#{clubChangeSpRecordID}
  59. </select>
  60. <select id="JgName" resultType="java.lang.String">
  61. SELECT `name` FROM `club` a
  62. LEFT JOIN clubchangesprecord b ON a.clubid = b.clubid
  63. WHERE b.clubChangeSpRecordID = #{clubChangeSpRecordID}
  64. </select>
  65. <select id="linkMan" resultType="java.lang.String">
  66. SELECT `linkMan` FROM `club` a
  67. LEFT JOIN clubchangesprecord b ON a.clubid = b.clubid
  68. WHERE b.clubChangeSpRecordID = #{clubChangeSpRecordID}
  69. </select>
  70. <select id="passName" resultType="java.lang.String">
  71. SELECT `name` FROM club a
  72. WHERE a.userID =#{userID}
  73. </select>
  74. <select id="PasslinkMan" resultType="java.lang.String">
  75. SELECT `linkMan` FROM club a
  76. WHERE a.userID =#{userID}
  77. </select>
  78. <select id="auditName" resultType="java.lang.String">
  79. SELECT name FROM club a
  80. WHERE a.clubID =#{clubID}
  81. </select>
  82. <select id="auditlinkMan" resultType="java.lang.String">
  83. SELECT linkMan FROM club a
  84. WHERE a.clubID =#{clubID}
  85. </select>
  86. <select id="newCmClub" resultType="NewCmClub">
  87. SELECT * FROM club WHERE clubID= #{clubID}
  88. </select>
  89. <select id="cmclubinfo" resultType="CmClubinfo">
  90. SELECT * FROM clubinfo
  91. WHERE clubInfoID = #{id}
  92. </select>
  93. <select id="temPorary" resultType="ClubTemporary">
  94. SELECT * FROM club_temporary
  95. WHERE id = #{id}
  96. </select>
  97. <select id="selOperationals" resultType="com.caimei.modules.user.entity.OperationalLogs">
  98. SELECT
  99. cpr.id as providerId,
  100. cpr.clubId,
  101. cpr.operator,
  102. cpr.createTime,
  103. CASE sp.status WHEN 91 THEN '采美默认协销经理(官方账号)' ELSE sp.linkMan END AS "spName"
  104. FROM cm_provider_record cpr
  105. LEFT JOIN serviceprovider sp ON sp.serviceProviderID = cpr.spID
  106. WHERE cpr.clubId = #{clubID}
  107. order by createTime desc
  108. </select>
  109. <insert id="inProvider">
  110. insert into cm_provider_record (spId, clubId, operator, createTime)
  111. values (#{spId}, #{clubId}, #{operator}, now())
  112. </insert>
  113. </mapper>