添加项目前缀,报404接口补全

This commit is contained in:
2026-07-08 16:37:39 +08:00
parent c43915105c
commit 157d2d20c4
50 changed files with 5589 additions and 11 deletions

View File

@@ -0,0 +1,56 @@
<?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.zf.foodpurchase.fdsafe.mapper.BrowseMapper">
<resultMap id="BaseResultMap" type="com.zf.foodpurchase.fdsafe.entity.Browse">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
<result column="remain_time" jdbcType="BIGINT" property="remainTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="nickname" jdbcType="VARCHAR" property="nickName"/>
<result column="dept_name" jdbcType="VARCHAR" property="merchantName"/>
<result column="product_name" jdbcType="VARCHAR" property="productName"/>
</resultMap>
<sql id="joinQuery">
select b.id,
b.user_id,
b.merchant_id,
b.product_id,
b.start_time,
b.end_time,
b.remain_time,
b.create_time,
IFNULL(u.nickname,'未设置昵称') as nickname,
m.dept_name,
p.product_name
from browse b inner join user u on b.user_id=u.id inner join sys_dept m on b.merchant_id=m.dept_id inner join products p on b.product_id=p.product_id
</sql>
<select id="joinQueryList" resultMap="BaseResultMap" parameterType="com.zf.foodpurchase.fdsafe.entity.Browse">
<include refid="joinQuery"/>
<where>
<if test="userId != null and userId != ''">
and b.user_id = #{userId}
</if>
<if test="merchantId != null and merchantId != ''">
and b.merchant_id = #{merchantId}
</if>
<if test="productId != null and productId != ''">
and b.product_id = #{productId}
</if>
<if test="queryBeginTime != null ">
and date_format(b.start_time, '%Y-%m-%d %H:%i:%s') &gt;= date_format(#{queryBeginTime}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="queryEndTime != null ">
and date_format(b.start_time, '%Y-%m-%d %H:%i:%s') &lt;= date_format(#{queryEndTime}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="productName !=null and productName != ''">
and p.product_name like concat('%',#{productName},'%')
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,70 @@
<?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.zf.foodpurchase.fdsafe.mapper.CarouselMapper">
<resultMap type="Carousel" id="CarouselResult">
<result property="carouselId" column="carousel_id" />
<result property="merchantId" column="merchant_id" />
<result property="merchantName" column="dept_name" />
<result property="carouselIamges" column="carousel_iamges" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectCarouselVo">
select carousel_id, c.merchant_id, carousel_iamges, c.create_time,c.update_time,dept_name from carousel c inner join sys_dept d on
c.merchant_id = d.dept_id
</sql>
<select id="selectCarouselList" parameterType="Carousel" resultMap="CarouselResult">
<include refid="selectCarouselVo"/>
<where>
<if test="merchantId != null "> and merchant_id = #{merchantId}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and c.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
<select id="selectCarouselByCarouselId" parameterType="Long" resultMap="CarouselResult">
<include refid="selectCarouselVo"/>
where carousel_id = #{carouselId}
</select>
<insert id="insertCarousel" parameterType="Carousel" useGeneratedKeys="true" keyProperty="carouselId">
insert into carousel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">merchant_id,</if>
<if test="carouselIamges != null and carouselIamges != ''">carousel_iamges,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">#{merchantId},</if>
<if test="carouselIamges != null and carouselIamges != ''">#{carouselIamges},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateCarousel" parameterType="Carousel">
update carousel
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="carouselIamges != null and carouselIamges != ''">carousel_iamges = #{carouselIamges},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where carousel_id = #{carouselId}
</update>
<delete id="deleteCarouselByCarouselId" parameterType="Long">
delete from carousel where carousel_id = #{carouselId}
</delete>
<delete id="deleteCarouselByCarouselIds" parameterType="String">
delete from carousel where carousel_id in
<foreach item="carouselId" collection="array" open="(" separator="," close=")">
#{carouselId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,211 @@
<?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.zf.foodpurchase.fdsafe.mapper.ProductsMapper">
<resultMap type="com.zf.foodpurchase.fdsafe.entity.Products" id="ProductsResult">
<result property="productId" column="product_id" />
<result property="merchantId" column="merchant_id" />
<result property="merchantName" column="dept_name" />
<result property="productName" column="product_name" />
<result property="description" column="description" />
<result property="basePrice" column="base_price" />
<result property="totalStock" column="total_stock" />
<result property="images" column="images" />
<result property="categoryId" column="category_id" />
<result property="status" column="status" />
<result property="type" column="type" />
<result property="baseIntegral" column="base_integral" />
<result property="baseReturnIntergral" column="base_return_intergral" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="operId" column="oper_id" />
<result property="delFlag" column="del_flag" />
<result property="detailImages" column="detail_images" />
<result property="isSpecs" column="is_specs" />
<result property="sailCount" column="sail_count" />
<result property="hot" column="hot" />
<result property="recommend" column="recommend" />
<result property="isNew" column="is_new" />
<result property="version" column="version" />
</resultMap>
<sql id="selectProductsVo">
select product_id, merchant_id,
d.dept_name as dept_name, product_name,
description, base_price, total_stock,
images, category_id, p.status as status,
type, base_integral, base_return_intergral,
p.create_time, p.update_time, oper_id,
p.del_flag as del_flag, detail_images ,
is_specs,
sail_count, hot, recommend,
is_new,version
from products p inner join sys_dept d on d.dept_id = p.merchant_id
</sql>
<select id="selectProductsList" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
<where>
<if test="merchantId != null "> and p.merchant_id = #{merchantId}</if>
<if test="productName != null and productName != ''"> and p.product_name like concat('%', #{productName}, '%')</if>
<if test="merchantName != null and merchantName != ''"> and d.dept_name like concat('%', #{merchantName}, '%')</if>
<if test="params.beginBasePrice != null and params.beginBasePrice != '' and params.endBasePrice != null and params.endBasePrice != ''"> and p.base_price between #{params.beginBasePrice} and #{params.endBasePrice}</if>
<if test="categoryId != null "> and p.category_id = #{categoryId}</if>
<if test="status != null "> and p.status = #{status}</if>
<if test="type != null "> and p.type = #{type}</if>
<if test="basePrice != null "> and p.base_price &lt;= #{basePrice}</if>
<if test="sailCount != null">and p.sail_count= #{sailCount},</if>
<if test="hot != null and hot!=''">and p.hot=#{hot},</if>
<if test="recommend != null and recommend">and p.recommend=#{recommend},</if>
<if test="isNew != null and isNew">and p.is_new=#{isNew},</if>
</where>
</select>
<select id="selectHotProducts" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
<where>
p.hot = '1'
and p.status = '1'
<if test="merchantId != null "> and p.merchant_id = #{merchantId}</if>
order by p.create_time desc
limit #{limitNum}
</where>
</select>
<select id="selectRecommendProducts" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
<where>
p.recommend = '1'
and p.status = '1'
<if test="merchantId != null "> and p.merchant_id = #{merchantId}</if>
order by p.create_time desc
limit #{limitNum}
</where>
</select>
<select id="selectNewProductsList" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
<where>
p.status = '1'
and p.is_new = '1'
<if test="merchantId != null "> and p.merchant_id = #{merchantId}</if>
order by p.create_time desc
limit #{limitNum}
</where>
</select>
<select id="selectSailCountProducts" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
<where>
p.status = '1'
<if test="merchantId != null "> and p.merchant_id = #{merchantId}</if>
order by p.sail_count desc
limit #{limitNum}
</where>
</select>
<select id="selectProductsByProductId" parameterType="Integer" resultMap="ProductsResult">
<include refid="selectProductsVo"/>
where product_id = #{productId} and p.del_flag = '0'
</select>
<insert id="insertProducts" parameterType="com.zf.foodpurchase.fdsafe.entity.Products" useGeneratedKeys="true" keyProperty="productId">
insert into products
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">merchant_id,</if>
<if test="productName != null and productName != ''">product_name,</if>
<if test="description != null">description,</if>
<if test="basePrice != null">base_price,</if>
<if test="totalStock != null">total_stock,</if>
<if test="images != null">images,</if>
<if test="categoryId != null">category_id,</if>
<if test="status != null">status,</if>
<if test="type != null">type,</if>
<if test="baseIntegral != null">base_integral,</if>
<if test="baseReturnIntergral != null">base_return_intergral,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="operId != null">oper_id,</if>
<if test="delFlag != null">del_flag,</if>
<if test="detailImages != null">detail_images,</if>
<if test="isSpecs != null">is_specs,</if>
<if test="sailCount != null">sail_count,</if>
<if test="hot != null and hot!=''">hot,</if>
<if test="recommend != null and recommend!=''">recommend,</if>
<if test="isNew != null and isNew!=''">is_new,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">#{merchantId},</if>
<if test="productName != null and productName != ''">#{productName},</if>
<if test="description != null">#{description},</if>
<if test="basePrice != null">#{basePrice},</if>
<if test="totalStock != null">#{totalStock},</if>
<if test="images != null">#{images},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="status != null">#{status},</if>
<if test="type != null">#{type},</if>
<if test="baseIntegral != null">#{baseIntegral},</if>
<if test="baseReturnIntergral != null">#{baseReturnIntergral},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="operId != null">#{operId},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="detailImages != null">#{detailImages},</if>
<if test="isSpecs != null">#{isSpecs},</if>
<if test="sailCount != null">#{sailCount},</if>
<if test="hot != null and recommend!=''">#{hot},</if>
<if test="recommend != null and recommend!=''">#{recommend},</if>
<if test="isNew != null and isNew!=''">#{isNew},</if>
</trim>
</insert>
<update id="updateProducts" parameterType="com.zf.foodpurchase.fdsafe.entity.Products">
update products
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="productName != null and productName != ''">product_name = #{productName},</if>
<if test="description != null">description = #{description},</if>
<if test="basePrice != null">base_price = #{basePrice},</if>
<if test="totalStock != null">total_stock = #{totalStock},</if>
<if test="images != null">images = #{images},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="status != null">status = #{status},</if>
<if test="type != null">type = #{type},</if>
<if test="baseIntegral != null">base_integral = #{baseIntegral},</if>
<if test="baseReturnIntergral != null">base_return_intergral = #{baseReturnIntergral},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="operId != null">oper_id = #{operId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="detailImages != null">detail_images = #{detailImages},</if>
<if test="isSpecs != null">is_specs = #{isSpecs},</if>
<if test="sailCount != null">sail_count= #{sailCount},</if>
<if test="hot != null and hot!=''">hot=#{hot},</if>
<if test="recommend != null and recommend!=''">recommend=#{recommend},</if>
<if test="isNew != null and isNew!=''">is_new=#{isNew},</if>
<if test="version != null">version=#{version}+1,</if>
</trim>
where product_id = #{productId} and version=#{version}
</update>
<delete id="deleteProductsByProductId" parameterType="Long">
delete from products where product_id = #{productId}
</delete>
<delete id="deleteProductsByProductIds" parameterType="String">
delete from products where product_id in
<foreach item="productId" collection="array" open="(" separator="," close=")">
#{productId}
</foreach>
</delete>
<update id="deleteProductsLogicByProductIds">
update products set del_flag = '1' where product_id in
<foreach item="productId" collection="array" open="(" separator="," close=")">
#{productId}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,29 @@
<?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.zf.foodpurchase.fdsafe.mapper.ProductsSpecMapper">
<update id="updateProductsSpec">
update products_spec
<trim prefix="SET" suffixOverrides=",">
<if test="productId != null">product_id = #{productId},</if>
<if test="specValues != null">spec_values = #{specValues},</if>
<if test="price != null">price = #{price},</if>
<if test="stock != null">stock = #{stock},</if>
<if test="type != null">type = #{type},</if>
<if test="integral != null">integral = #{integral},</if>
<if test="returnIntegral != null">return_integral = #{returnIntegral},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="operId != null">oper_id = #{operId},</if>
<if test="specImage != null">spec_image = #{specImage},</if>
<if test="psVersion != null">ps_version = #{psVersion}+1,</if>
</trim>
where id = #{id} and ps_version=#{psVersion}
</update>
<select id="selectMinOne" parameterType="Integer" resultType="java.util.Map">
select min(integral) as integral, min(price) as price from products_spec where product_id=#{productId}
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
<?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.zf.foodpurchase.fdsafe.mapper.RepositoryMapper">
<resultMap id="joinMap" type="com.zf.foodpurchase.fdsafe.entity.Repository">
<id column="id" property="id" />
<result column="merchant_id" property="merchantId" />
<result column="merchant_name" property="merchantName" />
<result column="repo_name" property="repoName" />
<result column="area_code" property="areaCode" />
<result column="detail_address" property="detailAddress" />
<result column="default_repo" property="defaultRepo" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="oper_id" property="operId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="joinColumn">
select r.id, r.merchant_id,r.repo_name, r.area_code, r.detail_address, r.default_repo, r.create_time, r.update_time, r.oper_id,d.dept_name as merchant_name
from repository r left join sys_dept d on r.merchant_id = d.dept_id
</sql>
<select id="joinQueryList" resultType="com.zf.foodpurchase.fdsafe.entity.Repository"
parameterType="com.zf.foodpurchase.fdsafe.entity.Repository">
<include refid="joinColumn"/>
<where>
<if test="id != null ">and r.id = #{id}</if>
<if test="merchantId != null ">and r.merchant_id = #{merchantId}</if>
<if test="areaCode != null ">and r.area_code = #{areaCode}</if>
<if test="detailAddress != null ">and r.detail_address = #{detailAddress}</if>
<if test="defaultRepo != null ">and r.default_repo = #{defaultRepo}</if>
<if test="operId != null ">and r.oper_id = #{operId}</if>
<if test="createTime != null ">and r.create_time = #{createTime}</if>
<if test="updateTime != null ">and r.update_time = #{updateTime}</if>
<if test="merchantName != null and merchantName !='' ">and d.dept_name like concat('%', #{merchantName}, '%') </if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,6 @@
<?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.zf.foodpurchase.fdsafe.mapper.SpecTypesMapper">
</mapper>

View File

@@ -0,0 +1,57 @@
<?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.zf.foodpurchase.fdsafe.mapper.SpecValuesMapper">
<sql id="baseColumn">
select
id,
spec_type as specType,
spec_value as specValue,
spec_unit as specUnit,
create_time as createTime,
update_time as updateTime,
oper_id as operId
from spec_values
</sql>
<sql id="joinColumn">
SELECT
v.id,
v.spec_type AS specType,
v.spec_value AS specValue,
v.spec_unit AS specUnit,
v.create_time AS createTime,
v.update_time AS updateTime,
v.oper_id AS operId,
t.spec_name AS specName
FROM
spec_values v
LEFT JOIN spec_types t ON v.spec_type = t.spec_type
</sql>
<select id="queryList" resultType="com.zf.foodpurchase.fdsafe.entity.SpecValues" parameterType="com.zf.foodpurchase.fdsafe.entity.SpecValues">
<include refid="joinColumn"/>
<where>
<if test="specType != null">
and v.spec_type = #{specType}
</if>
<if test="specValue != null">
and v.spec_value = #{specValue}
</if>
<if test="specUnit != null">
and v.spec_unit =#{specUnit}
</if>
</where>
</select>
<select id="queryByIds" resultType="com.zf.foodpurchase.fdsafe.entity.SpecValues">
<include refid="joinColumn"/>
<where>
<if test="list != null">
id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>