ProdAttrVoMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.xingxi.web.controller.master.product.mapper.ProdAttrVoMapper">
  4. <resultMap type="ProdAttrVo" id="ProdAttrVoResult">
  5. <result property="prodAttrId" column="prodAttrId" />
  6. <result property="prodId" column="prodId" />
  7. <result property="attrName" column="attrName" />
  8. <result property="attrType" column="attrType" />
  9. <result property="delFlag" column="delFlag" />
  10. <result property="createTime" column="createTime" />
  11. <result property="createUser" column="createUser" />
  12. <result property="updateUser" column="updateUser" />
  13. <result property="updateTime" column="updateTime" />
  14. <result property="jointId" column="jointId" />
  15. <result property="prodAttrJointId" column="prodAttrJointId" />
  16. </resultMap>
  17. <sql id="selectProdAttrVo">
  18. select m_prod_attr.prodAttrId
  19. , m_prod_attr.prodId
  20. , m_prod_attr.attrName
  21. , m_prod_attr.attrType
  22. , m_prod_attr.delFlag
  23. , m_prod_attr.createUser
  24. , m_prod_attr.createTime
  25. , m_prod_attr.updateUser
  26. , m_prod_attr.updateTime
  27. from m_prod_attr
  28. </sql>
  29. <select id="selectProdAttrVoByProdAttrId" parameterType="Long" resultMap="ProdAttrVoResult">
  30. <include refid="selectProdAttrVo"/>
  31. where prodAttrId = #{prodAttrId}
  32. </select>
  33. <select id="selectProdAttrVoList" parameterType="ProdAttrVo" resultMap="ProdAttrVoResult">
  34. <include refid="selectProdAttrVo"/>
  35. <where>
  36. <if test="prodId != null "> and m_prod_attr.prodId = #{prodId}</if>
  37. <if test="prodAttrId != null "> and m_prod_attr.prodAttrId = #{prodAttrId}</if>
  38. <if test="attrType != null "> and m_prod_attr.attrType = #{attrType}</if>
  39. <if test="attrName != null and attrName != ''"> and m_prod_attr.attrName like concat('%', #{attrName}, '%')</if>
  40. <if test="delFlag != null and delFlag != ''"> and m_prod_attr.delFlag = #{delFlag}</if>
  41. </where>
  42. </select>
  43. <select id="selectProdAttrJointList" parameterType="ProdAttrVo" resultMap="ProdAttrVoResult">
  44. select m_prod_attr.prodAttrId
  45. , m_prod_attr.prodId
  46. , m_prod_attr.attrName
  47. , m_prod_attr.attrType
  48. , m_prod_attr.delFlag
  49. , m_prod_attr.createUser
  50. , m_prod_attr.createTime
  51. , m_prod_attr.updateUser
  52. , m_prod_attr.updateTime
  53. , m_prod_attr_joint.prodAttrId as jointId
  54. , m_prod_attr_joint.prodAttrJointId
  55. from m_prod_attr
  56. left join m_prod_attr_joint on m_prod_attr.prodId = m_prod_attr_joint.jointProdId and m_prod_attr.prodAttrId = m_prod_attr_joint.jointProdAttrId
  57. <if test="jointId != null "> and m_prod_attr_joint.prodAttrId = #{jointId}</if>
  58. <if test="delFlag != null and delFlag != ''"> and m_prod_attr_joint.delFlag = #{delFlag}</if>
  59. <where>
  60. <if test="prodId != null "> and m_prod_attr.prodId = #{prodId}</if>
  61. <if test="prodAttrId != null "> and m_prod_attr.prodAttrId = #{prodAttrId}</if>
  62. <if test="attrType != null "> and m_prod_attr.attrType = #{attrType}</if>
  63. <if test="attrName != null and attrName != ''"> and m_prod_attr.attrName like concat('%', #{attrName}, '%')</if>
  64. <if test="delFlag != null and delFlag != ''"> and m_prod_attr.delFlag = #{delFlag}</if>
  65. </where>
  66. </select>
  67. </mapper>