| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.xingxi.web.controller.business.popular.mapper.PopularProdVoMapper">
- <resultMap type="PopularProdVo" id="PopularProdVoResult">
- <result property="id" column="id" />
- <result property="mercProdId" column="mercProdId" />
- <result property="sort" column="sort" />
- <result property="delFlag" column="delFlag" />
- <result property="createUser" column="createUser" />
- <result property="createTime" column="createTime" />
- <result property="updateUser" column="updateUser" />
- <result property="updateTime" column="updateTime" />
- <result property="prodId" column="prodId" />
- <result property="prodName" column="prodName" />
- <result property="attrName" column="attrName" />
- </resultMap>
- <sql id="selectPopularProdVo">
- select t_popular_prod.id
- , t_popular_prod.mercProdId
- , t_popular_prod.sort
- , t_popular_prod.delFlag
- , t_popular_prod.createUser
- , t_popular_prod.createTime
- , t_popular_prod.updateUser
- , t_popular_prod.updateTime
- , m_merchant_prod.prodId
- , m_prod.prodName
- , m_prod_attr.attrName
- from t_popular_prod
- inner join m_merchant_prod on m_merchant_prod.mercProdId = t_popular_prod.mercProdId
- inner join m_prod on m_prod.id = m_merchant_prod.prodId
- inner join m_prod_attr on m_prod_attr.prodId = m_merchant_prod.prodId and m_prod_attr.prodAttrId = m_merchant_prod.prodAttrId
- </sql>
- <select id="selectPopularProdVoList" parameterType="PopularProdVo" resultMap="PopularProdVoResult">
- <include refid="selectPopularProdVo"/>
- <where>
- <if test="mercProdId != null "> and t_popular_prod.mercProdId = #{mercProdId}</if>
- <if test="sort != null "> and t_popular_prod.sort = #{sort}</if>
- <if test="delFlag != null and delFlag != ''"> and t_popular_prod.delFlag = #{delFlag}</if>
- <if test="createUser != null and createUser != ''"> and t_popular_prod.createUser = #{createUser}</if>
- <if test="createTime != null "> and t_popular_prod.createTime = #{createTime}</if>
- <if test="updateUser != null and updateUser != ''"> and t_popular_prod.updateUser = #{updateUser}</if>
- <if test="updateTime != null "> and t_popular_prod.updateTime = #{updateTime}</if>
- <if test="prodName != null and prodName != ''"> and m_prod.prodName like concat('%', #{prodName}, '%')</if>
- <if test="attrName != null and attrName != ''"> and m_prod_attr.attrName like concat('%', #{attrName}, '%')</if>
- </where>
- order by t_popular_prod.sort
- </select>
- </mapper>
|