AttrValueServiceDaoImplMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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="attrValueServiceDaoImpl">
  6. <!-- 保存属性值信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveAttrValueInfo" parameterType="Map">
  8. insert into attr_value(
  9. value_id,value_name,value_show,spec_id,value
  10. ) values (
  11. #{valueId},#{valueName},#{valueShow},#{specId},#{value}
  12. )
  13. </insert>
  14. <!-- 查询属性值信息 add by wuxw 2018-07-03 -->
  15. <select id="getAttrValueInfo" parameterType="Map" resultType="Map">
  16. select t.value_id,t.value_id valueId,t.value_name,t.value_name valueName,t.value_show,t.value_show
  17. valueShow,t.spec_id,t.spec_id specId,t.status_cd,t.status_cd statusCd,t.value
  18. from attr_value t
  19. LEFT JOIN attr_spec spec on t.spec_id = spec.spec_id and spec.status_cd = '0'
  20. where 1 =1
  21. <if test="valueId !=null and valueId != ''">
  22. and t.value_id= #{valueId}
  23. </if>
  24. <if test="domain !=null and domain != ''">
  25. and spec.domain= #{domain}
  26. </if>
  27. <if test="specCd !=null and specCd != ''">
  28. and spec.spec_cd= #{specCd}
  29. </if>
  30. <if test="valueName !=null and valueName != ''">
  31. and t.value_name= #{valueName}
  32. </if>
  33. <if test="valueShow !=null and valueShow != ''">
  34. and t.value_show= #{valueShow}
  35. </if>
  36. <if test="specId !=null and specId != ''">
  37. and t.spec_id= #{specId}
  38. </if>
  39. <if test="statusCd !=null and statusCd != ''">
  40. and t.status_cd= #{statusCd}
  41. </if>
  42. <if test="value !=null and value != ''">
  43. and t.value= #{value}
  44. </if>
  45. order by t.create_time desc
  46. <if test="page != -1 and page != null ">
  47. limit #{page}, #{row}
  48. </if>
  49. </select>
  50. <!-- 修改属性值信息 add by wuxw 2018-07-03 -->
  51. <update id="updateAttrValueInfo" parameterType="Map">
  52. update attr_value t set t.status_cd = #{statusCd}
  53. <if test="newBId != null and newBId != ''">
  54. ,t.b_id = #{newBId}
  55. </if>
  56. <if test="valueName !=null and valueName != ''">
  57. , t.value_name= #{valueName}
  58. </if>
  59. <if test="valueShow !=null and valueShow != ''">
  60. , t.value_show= #{valueShow}
  61. </if>
  62. <if test="specId !=null and specId != ''">
  63. , t.spec_id= #{specId}
  64. </if>
  65. <if test="value !=null and value != ''">
  66. , t.value= #{value}
  67. </if>
  68. where 1=1
  69. <if test="valueId !=null and valueId != ''">
  70. and t.value_id= #{valueId}
  71. </if>
  72. </update>
  73. <!-- 查询属性值数量 add by wuxw 2018-07-03 -->
  74. <select id="queryAttrValuesCount" parameterType="Map" resultType="Map">
  75. select count(1) count
  76. from attr_value t
  77. LEFT JOIN attr_spec spec on t.spec_id = spec.spec_id and spec.status_cd = '0'
  78. where 1 =1
  79. <if test="valueId !=null and valueId != ''">
  80. and t.value_id= #{valueId}
  81. </if>
  82. <if test="domain !=null and domain != ''">
  83. and spec.domain= #{domain}
  84. </if>
  85. <if test="specCd !=null and specCd != ''">
  86. and spec.spec_cd= #{specCd}
  87. </if>
  88. <if test="valueId !=null and valueId != ''">
  89. and t.value_id= #{valueId}
  90. </if>
  91. <if test="valueName !=null and valueName != ''">
  92. and t.value_name= #{valueName}
  93. </if>
  94. <if test="valueShow !=null and valueShow != ''">
  95. and t.value_show= #{valueShow}
  96. </if>
  97. <if test="specId !=null and specId != ''">
  98. and t.spec_id= #{specId}
  99. </if>
  100. <if test="statusCd !=null and statusCd != ''">
  101. and t.status_cd= #{statusCd}
  102. </if>
  103. <if test="value !=null and value != ''">
  104. and t.value= #{value}
  105. </if>
  106. </select>
  107. </mapper>