修改产品功能

This commit is contained in:
wuweihua
2026-09-28 16:26:55 +08:00
parent 32ab61b51c
commit 623df69d4b
12 changed files with 217 additions and 93 deletions
@@ -96,6 +96,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="effectStatus != null and effectStatus != ''">
AND p.status = #{effectStatus}
</if>
<if test="statusGroup != null and statusGroup == 'active'">
AND p.status in ('0', '1')
</if>
<if test="statusGroup != null and statusGroup == 'expired'">
AND p.status = '2'
<if test="params != null and params.beginTime != null and params.beginTime != ''">
AND p.expire_date &gt;= #{params.beginTime}
</if>
<if test="params != null and params.endTime != null and params.endTime != ''">
AND p.expire_date &lt;= #{params.endTime}
</if>
</if>
<if test="cargoAttr != null and cargoAttr != ''">
AND p.cargo_attr like concat('%', #{cargoAttr}, '%')
</if>
@@ -104,7 +116,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
OR p.product_name like concat('%', #{params.keyword}, '%'))
</if>
</where>
order by p.product_code asc, p.effective_date desc, p.product_id desc
<choose>
<when test="statusGroup != null and statusGroup == 'expired'">
order by p.expire_date desc, p.product_code asc, p.product_id desc
</when>
<otherwise>
order by p.product_code asc, p.effective_date desc, p.product_id desc
</otherwise>
</choose>
</select>
<insert id="insertBmsProduct" parameterType="BmsProduct" useGeneratedKeys="true" keyProperty="productId">
@@ -171,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ifnull(c.status, '1') &lt;&gt; '2'
<choose>
<when test="openOnly">
and (c.effective_date is null or date(c.effective_date) &lt;= curdate())
and (c.expire_date is null or date(c.expire_date) &gt; curdate())
</when>
<otherwise>