修改产品功能
This commit is contained in:
@@ -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 >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null and params.endTime != ''">
|
||||
AND p.expire_date <= #{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') <> '2'
|
||||
<choose>
|
||||
<when test="openOnly">
|
||||
and (c.effective_date is null or date(c.effective_date) <= curdate())
|
||||
and (c.expire_date is null or date(c.expire_date) > curdate())
|
||||
</when>
|
||||
<otherwise>
|
||||
|
||||
Reference in New Issue
Block a user