1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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.fjhx.item.mapper.product.ProductInfoMapper">
- <select id="getPage" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
- SELECT
- pi.id,
- pi.definition,
- pi.product_classify_id,
- pi.CODE,
- pi.type,
- pi.NAME,
- pi.spec,
- pi.unit,
- pi.remark,
- pi.create_user,
- pi.create_time,
- pi.update_user,
- pi.update_time,
- pi.victoriatourist_json,
- IF(DATEDIFF(now(),json_unquote( victoriatourist_json -> '$.growUpDay' ))> 0,3,IF(DATEDIFF(now(), json_unquote(victoriatourist_json -> '$.newProductsDay' ))> 0, 2, 1 )) AS lifeCycle
- FROM
- product_info pi
- ${ew.customSqlSegment}
- </select>
- <select id="getListByProductIds" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
- SELECT
- t1.*,
- t2.`name` AS classifyName
- FROM
- product_info t1
- LEFT JOIN product_classify t2 ON t1.product_classify_id = t2.id
- <where>
- <if test="productIds neq null and productIds.size() > 0">
- <foreach collection="productIds" item="productId" open="t1.id IN (" separator="," close=")">
- #{productId}
- </foreach>
- </if>
- </where>
- </select>
- <select id="getListByProductType" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
- SELECT
- t1.*,
- t2.`name` AS classifyName
- FROM
- product_info t1
- LEFT JOIN product_classify t2 ON t1.product_classify_id = t2.id
- <where>
- <if test="productType neq null ">
- t1.type = #{productType}
- </if>
- </where>
- </select>
- </mapper>
|