MenuGroupV1ServiceDaoImplMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="menuGroupV1ServiceDaoImpl">
  6. <!-- 保存商户信息信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMenuGroupInfo" parameterType="Map">
  8. insert into m_menu_group(
  9. group_type,store_type,g_id,name,icon,description,label,seq
  10. ) values (
  11. #{groupType},#{storeType},#{gId},#{name},#{icon},#{description},#{label},#{seq}
  12. )
  13. </insert>
  14. <!-- 查询商户信息信息 add by wuxw 2018-07-03 -->
  15. <select id="getMenuGroupInfo" parameterType="Map" resultType="Map">
  16. select t.group_type,t.group_type groupType,t.store_type,t.store_type storeType,t.g_id,t.g_id
  17. gId,t.name,t.icon,t.description,t.status_cd,t.status_cd statusCd,t.label,t.seq
  18. from m_menu_group t
  19. where 1 =1
  20. <if test="groupType !=null and groupType != ''">
  21. and t.group_type= #{groupType}
  22. </if>
  23. <if test="storeType !=null and storeType != ''">
  24. and t.store_type= #{storeType}
  25. </if>
  26. <if test="gId !=null and gId != ''">
  27. and t.g_id= #{gId}
  28. </if>
  29. <if test="gIds !=null">
  30. and t.g_id in
  31. <foreach collection="gIds" item="item" open="(" close=")" separator=",">
  32. #{item}
  33. </foreach>
  34. </if>
  35. <if test="name !=null and name != ''">
  36. and t.name= #{name}
  37. </if>
  38. <if test="icon !=null and icon != ''">
  39. and t.icon= #{icon}
  40. </if>
  41. <if test="description !=null and description != ''">
  42. and t.description= #{description}
  43. </if>
  44. <if test="statusCd !=null and statusCd != ''">
  45. and t.status_cd= #{statusCd}
  46. </if>
  47. <if test="label !=null and label != ''">
  48. and t.label= #{label}
  49. </if>
  50. <if test="seq !=null and seq != ''">
  51. and t.seq= #{seq}
  52. </if>
  53. order by t.create_time desc
  54. <if test="page != -1 and page != null ">
  55. limit #{page}, #{row}
  56. </if>
  57. </select>
  58. <!-- 修改商户信息信息 add by wuxw 2018-07-03 -->
  59. <update id="updateMenuGroupInfo" parameterType="Map">
  60. update m_menu_group t set t.status_cd = #{statusCd}
  61. <if test="newBId != null and newBId != ''">
  62. ,t.b_id = #{newBId}
  63. </if>
  64. <if test="groupType !=null and groupType != ''">
  65. , t.group_type= #{groupType}
  66. </if>
  67. <if test="storeType !=null and storeType != ''">
  68. , t.store_type= #{storeType}
  69. </if>
  70. <if test="name !=null and name != ''">
  71. , t.name= #{name}
  72. </if>
  73. <if test="icon !=null and icon != ''">
  74. , t.icon= #{icon}
  75. </if>
  76. <if test="description !=null and description != ''">
  77. , t.description= #{description}
  78. </if>
  79. <if test="label !=null and label != ''">
  80. , t.label= #{label}
  81. </if>
  82. <if test="seq !=null and seq != ''">
  83. , t.seq= #{seq}
  84. </if>
  85. where 1=1
  86. <if test="gId !=null and gId != ''">
  87. and t.g_id= #{gId}
  88. </if>
  89. </update>
  90. <!-- 查询商户信息数量 add by wuxw 2018-07-03 -->
  91. <select id="queryMenuGroupsCount" parameterType="Map" resultType="Map">
  92. select count(1) count
  93. from m_menu_group t
  94. where 1 =1
  95. <if test="groupType !=null and groupType != ''">
  96. and t.group_type= #{groupType}
  97. </if>
  98. <if test="storeType !=null and storeType != ''">
  99. and t.store_type= #{storeType}
  100. </if>
  101. <if test="gId !=null and gId != ''">
  102. and t.g_id= #{gId}
  103. </if>
  104. <if test="gIds !=null">
  105. and t.g_id in
  106. <foreach collection="gIds" item="item" open="(" close=")" separator=",">
  107. #{item}
  108. </foreach>
  109. </if>
  110. <if test="name !=null and name != ''">
  111. and t.name= #{name}
  112. </if>
  113. <if test="icon !=null and icon != ''">
  114. and t.icon= #{icon}
  115. </if>
  116. <if test="description !=null and description != ''">
  117. and t.description= #{description}
  118. </if>
  119. <if test="statusCd !=null and statusCd != ''">
  120. and t.status_cd= #{statusCd}
  121. </if>
  122. <if test="label !=null and label != ''">
  123. and t.label= #{label}
  124. </if>
  125. <if test="seq !=null and seq != ''">
  126. and t.seq= #{seq}
  127. </if>
  128. </select>
  129. </mapper>