Browse Source

优惠券查询

suochencheng 6 years ago
parent
commit
1a20c7fbed

+ 7 - 0
src/main/java/com/izouma/awesomeadmin/dao/CouponInfoMapper.xml

@@ -478,6 +478,9 @@
             <if test="storeId != null and !&quot;&quot;.equals(storeId)">
                 and store_id = #{storeId}
             </if>
+            <if test="checkTime != null and !&quot;&quot;.equals(checkTime)">
+                <![CDATA[ AND  begin_time < NOW() AND  end_time > NOW() ]]>
+            </if>
             <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                 <trim prefix="and (" suffix=")" prefixOverrides="OR">
                     OR name LIKE concat('%',#{searchKey},'%')
@@ -540,6 +543,10 @@
         </if>
 
         id desc
+
+        <if test="limitNum != null and !&quot;&quot;.equals(limitNum)">
+            LIMIT #{limitNum}
+        </if>
     </select>
     <select id="queryCouponInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CouponInfo">
         select

+ 26 - 0
src/main/java/com/izouma/awesomeadmin/model/CouponInfo.java

@@ -67,6 +67,16 @@ public class CouponInfo {
      */
     private String orderByStr;
 
+    /**
+     * 检查时间有效
+     */
+    private String checkTime;
+
+    /**
+     * 查询数量
+     */
+    private Integer limitNum;
+
     public Integer getId() {
         return this.id;
     }
@@ -290,5 +300,21 @@ public class CouponInfo {
     public void setUserCount(Integer userCount) {
         this.userCount = userCount;
     }
+
+    public String getCheckTime() {
+        return checkTime;
+    }
+
+    public void setCheckTime(String checkTime) {
+        this.checkTime = checkTime;
+    }
+
+    public Integer getLimitNum() {
+        return limitNum;
+    }
+
+    public void setLimitNum(Integer limitNum) {
+        this.limitNum = limitNum;
+    }
 }