123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?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="cn.cslg.pas.mapper.ProductMapper">
- <!--namespace根据自己需要创建的的mapper的路径和名称填写-->
- <select id="getProduct" resultType="cn.cslg.pas.common.vo.business.ProductVO">
- select product.id as id ,product.name as name , product.license_rate as licenseRate
- ,product.category_id as categoryId,product.show_type as showType
- ,product.description as description,
- product.create_id as createId, product.tenant_id as tenantId,
- product.market_time as
- marketTime,product.create_time as createTime,
- product.company_name,product.description as description
- from
- product as product left join product_category as category
- on category.id = product.category_id
- <if test="sql1!=''">
- where ${sql1}
- </if>
- ${sql2} ${sql3}
- </select>
- <select id="getProductCount" resultType="java.lang.Long">
- select count(*)
- from product as product left join product_category as category
- on category.id = product.category_id
- <if test="sql!=''">
- where ${sql}
- </if>
- </select>
- <select id="getProductOrCategoryNameOrder" resultType="cn.cslg.pas.common.vo.ProductOrCategoryVO">
- select *
- from (select id as id, name as name, 2 as type
- from product
- union all
- select id as id, name as name, 3 as type
- from product_category) as c
- order by name
- <if test="orderType==0">
- asc
- </if>
- <if test="orderType!=0">
- desc
- </if>
- </select>
- </mapper>
|