CmMallOrganizeMapper.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.weisha.dao.CmMallOrganizeDao">
  4. <sql id="cmMallOrganizeColumns">
  5. a.id AS "id",
  6. a.organizeName AS "organizeName",
  7. a.organizeLinkName AS "organizeLinkName",
  8. a.mobile AS "mobile",
  9. a.status AS "status",
  10. a.contactNumber AS "contactNumber",
  11. a.systemName AS "systemName",
  12. a.systemImage AS "systemImage",
  13. a.introduction AS "introduction",
  14. a.afterSale AS "afterSale",
  15. a.shoppingNotes AS "shoppingNotes",
  16. a.updateTime AS "updateTime",
  17. a.addTime AS "addTime",
  18. a.delFlag AS "delFlag"
  19. </sql>
  20. <sql id="cmMallOrganizeJoins">
  21. </sql>
  22. <select id="get" resultType="CmMallOrganize">
  23. SELECT
  24. <include refid="cmMallOrganizeColumns"/>
  25. FROM cm_mall_organize a
  26. <include refid="cmMallOrganizeJoins"/>
  27. WHERE a.id = #{id}
  28. </select>
  29. <select id="findList" resultType="CmMallOrganize">
  30. SELECT
  31. <include refid="cmMallOrganizeColumns"/>
  32. FROM cm_mall_organize a
  33. <include refid="cmMallOrganizeJoins"/>
  34. <where>
  35. id > 2
  36. <if test="organizeName != null and organizeName != ''">
  37. AND a.organizeName = #{organizeName}
  38. </if>
  39. <if test="organizeLinkName != null and organizeLinkName != ''">
  40. AND a.organizeLinkName = #{organizeLinkName}
  41. </if>
  42. <if test="mobile != null and mobile != ''">
  43. AND a.mobile = #{mobile}
  44. </if>
  45. <if test="status != null and status != ''">
  46. AND a.status = #{status}
  47. </if>
  48. </where>
  49. <choose>
  50. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  51. ORDER BY ${page.orderBy}
  52. </when>
  53. <otherwise>
  54. ORDER BY a.addTime DESC
  55. </otherwise>
  56. </choose>
  57. </select>
  58. <select id="findAllList" resultType="CmMallOrganize">
  59. SELECT
  60. <include refid="cmMallOrganizeColumns"/>
  61. FROM cm_mall_organize a
  62. <include refid="cmMallOrganizeJoins"/>
  63. <where>
  64. </where>
  65. <choose>
  66. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  67. ORDER BY ${page.orderBy}
  68. </when>
  69. <otherwise>
  70. </otherwise>
  71. </choose>
  72. </select>
  73. <insert id="insert" parameterType="CmMallOrganize" keyProperty="id" useGeneratedKeys="true">
  74. INSERT INTO cm_mall_organize(
  75. organizeName,
  76. organizeLinkName,
  77. mobile,
  78. status,
  79. contactNumber,
  80. systemName,
  81. systemImage,
  82. introduction,
  83. afterSale,
  84. shoppingNotes,
  85. updateTime,
  86. addTime,
  87. delFlag
  88. ) VALUES (
  89. #{organizeName},
  90. #{organizeLinkName},
  91. #{mobile},
  92. #{status},
  93. #{contactNumber},
  94. #{systemName},
  95. #{systemImage},
  96. #{introduction},
  97. #{afterSale},
  98. #{shoppingNotes},
  99. NOW(),
  100. NOW(),
  101. 0
  102. )
  103. </insert>
  104. <update id="update">
  105. UPDATE cm_mall_organize SET
  106. organizeName = #{organizeName},
  107. organizeLinkName = #{organizeLinkName},
  108. mobile = #{mobile},
  109. status = #{status},
  110. contactNumber = #{contactNumber},
  111. systemName = #{systemName},
  112. systemImage = #{systemImage},
  113. introduction = #{introduction},
  114. afterSale = #{afterSale},
  115. shoppingNotes = #{shoppingNotes},
  116. updateTime = NOW()
  117. WHERE id = #{id}
  118. </update>
  119. <update id="updateByStatus">
  120. UPDATE cm_mall_organize SET
  121. status = #{status},
  122. updateTime = NOW()
  123. WHERE id = #{organizeId}
  124. </update>
  125. <select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
  126. SELECT
  127. <include refid="cmMallOrganizeColumns"/>
  128. FROM cm_mall_organize a
  129. WHERE a.mobile = #{mobile} AND a.delFlag = 0
  130. <if test="id != null">
  131. AND a.id != #{id}
  132. </if>
  133. </select>
  134. </mapper>