CmOperationalLogsMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.CmOperationsDao">
  4. <select id="findList" resultType="com.caimei.modules.user.entity.CmOperationalLogs">
  5. SELECT institutionName, Contact, operationtype, Actioncontent, Operator, Operationtime
  6. FROM `cm_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.CmOperationalLogs" keyProperty="id"
  35. useGeneratedKeys="true">
  36. INSERT INTO cm_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="shoplist" resultType="NewCmShop">
  51. SELECT * FROM `shop` s
  52. LEFT JOIN `user` u ON u.userID = s.userID
  53. WHERE s.shopID = #{shopID}
  54. </select>
  55. <select id="userlist" resultType="NewCmShop">
  56. SELECT * FROM `shop` s
  57. LEFT JOIN `user` u ON u.userID = s.userID
  58. WHERE s.userID = #{userID}
  59. </select>
  60. </mapper>