ShopVipAccountServiceDaoImplMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="shopVipAccountServiceDaoImpl">
  6. <!-- 保存会员账户信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveShopVipAccountInfo" parameterType="Map">
  8. insert into shop_vip_account(
  9. amount,vip_acct_id,vip_id,acct_type,shop_id,acct_name,store_id
  10. ) values (
  11. #{amount},#{vipAcctId},#{vipId},#{acctType},#{shopId},#{acctName},#{storeId}
  12. )
  13. </insert>
  14. <!-- 查询会员账户信息 add by wuxw 2018-07-03 -->
  15. <select id="getShopVipAccountInfo" parameterType="Map" resultType="Map">
  16. select t.amount,t.vip_acct_id,t.vip_acct_id vipAcctId,t.vip_id,t.vip_id vipId,t.acct_type,t.acct_type
  17. acctType,t.status_cd,t.status_cd statusCd,t.shop_id,t.shop_id shopId,t.acct_name,t.acct_name
  18. acctName,t.store_id,t.store_id storeId,t.create_time createTime,td.`name` acctTypeName
  19. from shop_vip_account t
  20. LEFT JOIN t_dict td on td.status_cd = t.acct_type and td.table_name = 'shop_vip_account' and td.table_columns = 'acct_type'
  21. where 1 =1
  22. <if test="amount !=null and amount != ''">
  23. and t.amount= #{amount}
  24. </if>
  25. <if test="vipAcctId !=null and vipAcctId != ''">
  26. and t.vip_acct_id= #{vipAcctId}
  27. </if>
  28. <if test="vipId !=null and vipId != ''">
  29. and t.vip_id= #{vipId}
  30. </if>
  31. <if test="acctType !=null and acctType != ''">
  32. and t.acct_type= #{acctType}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="shopId !=null and shopId != ''">
  38. and t.shop_id= #{shopId}
  39. </if>
  40. <if test="acctName !=null and acctName != ''">
  41. and t.acct_name= #{acctName}
  42. </if>
  43. <if test="storeId !=null and storeId != ''">
  44. and t.store_id= #{storeId}
  45. </if>
  46. order by t.create_time desc
  47. <if test="page != -1 and page != null ">
  48. limit #{page}, #{row}
  49. </if>
  50. </select>
  51. <!-- 修改会员账户信息 add by wuxw 2018-07-03 -->
  52. <update id="updateShopVipAccountInfo" parameterType="Map">
  53. update shop_vip_account t set t.status_cd = #{statusCd}
  54. <if test="newBId != null and newBId != ''">
  55. ,t.b_id = #{newBId}
  56. </if>
  57. <if test="amount !=null and amount != ''">
  58. , t.amount= #{amount}
  59. </if>
  60. <if test="vipId !=null and vipId != ''">
  61. , t.vip_id= #{vipId}
  62. </if>
  63. <if test="acctType !=null and acctType != ''">
  64. , t.acct_type= #{acctType}
  65. </if>
  66. <if test="acctName !=null and acctName != ''">
  67. , t.acct_name= #{acctName}
  68. </if>
  69. <if test="storeId !=null and storeId != ''">
  70. , t.store_id= #{storeId}
  71. </if>
  72. where 1=1
  73. <if test="vipAcctId !=null and vipAcctId != ''">
  74. and t.vip_acct_id= #{vipAcctId}
  75. </if>
  76. <if test="shopId !=null and shopId != ''">
  77. and t.shop_id= #{shopId}
  78. </if>
  79. </update>
  80. <!-- 查询会员账户数量 add by wuxw 2018-07-03 -->
  81. <select id="queryShopVipAccountsCount" parameterType="Map" resultType="Map">
  82. select count(1) count
  83. from shop_vip_account t
  84. where 1 =1
  85. <if test="amount !=null and amount != ''">
  86. and t.amount= #{amount}
  87. </if>
  88. <if test="vipAcctId !=null and vipAcctId != ''">
  89. and t.vip_acct_id= #{vipAcctId}
  90. </if>
  91. <if test="vipId !=null and vipId != ''">
  92. and t.vip_id= #{vipId}
  93. </if>
  94. <if test="acctType !=null and acctType != ''">
  95. and t.acct_type= #{acctType}
  96. </if>
  97. <if test="statusCd !=null and statusCd != ''">
  98. and t.status_cd= #{statusCd}
  99. </if>
  100. <if test="shopId !=null and shopId != ''">
  101. and t.shop_id= #{shopId}
  102. </if>
  103. <if test="acctName !=null and acctName != ''">
  104. and t.acct_name= #{acctName}
  105. </if>
  106. <if test="storeId !=null and storeId != ''">
  107. and t.store_id= #{storeId}
  108. </if>
  109. </select>
  110. </mapper>