add gao product
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?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.imyeyu.api.modules.gao.mapper.GaoProductMapper">
|
||||
<select id="countByQuery" resultType="long">
|
||||
SELECT COUNT(1) FROM `gao_product`
|
||||
WHERE `deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">AND `store_id` = #{storeId}</if>
|
||||
<choose>
|
||||
<when test="categoryIdList != null and categoryIdList.size() > 0">
|
||||
AND `category_id` IN <foreach collection="categoryIdList" item="categoryIdItem" separator="," open="(" close=")">#{categoryIdItem}</foreach>
|
||||
</when>
|
||||
<when test="categoryId != null and categoryId != ''">AND `category_id` = #{categoryId}</when>
|
||||
</choose>
|
||||
<if test="status != null">AND `status` = #{status}</if>
|
||||
<if test="productType != null">AND `product_type` = #{productType}</if>
|
||||
<if test="keyword != null and keyword.trim() != ''">AND (`code` LIKE CONCAT('%', #{keyword}, '%') OR `name` LIKE CONCAT('%', #{keyword}, '%'))</if>
|
||||
</select>
|
||||
<select id="selectByQuery" resultType="com.imyeyu.api.modules.gao.entity.GaoProduct">
|
||||
SELECT * FROM `gao_product`
|
||||
WHERE `deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">AND `store_id` = #{storeId}</if>
|
||||
<choose>
|
||||
<when test="categoryIdList != null and categoryIdList.size() > 0">
|
||||
AND `category_id` IN <foreach collection="categoryIdList" item="categoryIdItem" separator="," open="(" close=")">#{categoryIdItem}</foreach>
|
||||
</when>
|
||||
<when test="categoryId != null and categoryId != ''">AND `category_id` = #{categoryId}</when>
|
||||
</choose>
|
||||
<if test="status != null">AND `status` = #{status}</if>
|
||||
<if test="productType != null">AND `product_type` = #{productType}</if>
|
||||
<if test="keyword != null and keyword.trim() != ''">AND (`code` LIKE CONCAT('%', #{keyword}, '%') OR `name` LIKE CONCAT('%', #{keyword}, '%'))</if>
|
||||
ORDER BY `sort`, `name`, `code`, `created_at` DESC
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
<select id="selectByStoreIdAndCode" resultType="com.imyeyu.api.modules.gao.entity.GaoProduct">
|
||||
SELECT * FROM `gao_product`
|
||||
WHERE `store_id` = #{storeId} AND `code` = #{code} AND `deleted_at` IS NULL
|
||||
<if test="excludeId != null">AND `id` != #{excludeId}</if>
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectForUpdate" resultType="com.imyeyu.api.modules.gao.entity.GaoProduct">
|
||||
SELECT * FROM `gao_product`
|
||||
WHERE `id` = #{id} AND `deleted_at` IS NULL
|
||||
FOR UPDATE
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user