浏览代码

悦所4月份测试开发2

huan.wang 6 年之前
父节点
当前提交
df7c15f8c3

+ 93 - 84
src/main/java/com/ygj/yuemum/domain/wxmini/WXPromotion.java

@@ -1,85 +1,94 @@
-package com.ygj.yuemum.domain.wxmini;
-
-public class WXPromotion {
-    private Integer id;
-    private String wp_name;
-    private String wp_desc;
-    private String wp_url;
-    private String wp_href;
-    private String wp_index_url;
-    private String wp_startdate;
-    private String wp_enddate;
-    private String wp_isexpire;
-
-    public String getWp_index_url() {
-        return wp_index_url;
-    }
-
-    public void setWp_index_url(String wp_index_url) {
-        this.wp_index_url = wp_index_url;
-    }
-
-    public String getWp_isexpire() {
-        return wp_isexpire;
-    }
-
-    public void setWp_isexpire(String wp_isexpire) {
-        this.wp_isexpire = wp_isexpire;
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getWp_name() {
-        return wp_name;
-    }
-
-    public void setWp_name(String wp_name) {
-        this.wp_name = wp_name;
-    }
-
-    public String getWp_desc() {
-        return wp_desc;
-    }
-
-    public void setWp_desc(String wp_desc) {
-        this.wp_desc = wp_desc;
-    }
-
-    public String getWp_url() {
-        return wp_url;
-    }
-
-    public void setWp_url(String wp_url) {
-        this.wp_url = wp_url;
-    }
-
-    public String getWp_href() {
-        return wp_href;
-    }
-
-    public void setWp_href(String wp_href) {
-        this.wp_href = wp_href;
-    }
-
-    public String getWp_startdate() {
-        return wp_startdate;
-    }
-
-    public void setWp_startdate(String wp_startdate) {
-        this.wp_startdate = wp_startdate;
-    }
-
-    public String getWp_enddate() {
-        return wp_enddate;
-    }
-
-    public void setWp_enddate(String wp_enddate) {
-        this.wp_enddate = wp_enddate;
-    }
+package com.ygj.yuemum.domain.wxmini;
+
+public class WXPromotion {
+    private Integer id;
+    private String wp_name;
+    private String wp_desc;
+    private String wp_url;
+    private String wp_href;
+    private String wp_index_url;
+    private String wp_startdate;
+    private String wp_enddate;
+    private String wp_isexpire;
+    private Integer wp_type;
+
+    public Integer getWp_type() {
+        return wp_type;
+    }
+
+    public void setWp_type(Integer wp_type) {
+        this.wp_type = wp_type;
+    }
+
+    public String getWp_index_url() {
+        return wp_index_url;
+    }
+
+    public void setWp_index_url(String wp_index_url) {
+        this.wp_index_url = wp_index_url;
+    }
+
+    public String getWp_isexpire() {
+        return wp_isexpire;
+    }
+
+    public void setWp_isexpire(String wp_isexpire) {
+        this.wp_isexpire = wp_isexpire;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getWp_name() {
+        return wp_name;
+    }
+
+    public void setWp_name(String wp_name) {
+        this.wp_name = wp_name;
+    }
+
+    public String getWp_desc() {
+        return wp_desc;
+    }
+
+    public void setWp_desc(String wp_desc) {
+        this.wp_desc = wp_desc;
+    }
+
+    public String getWp_url() {
+        return wp_url;
+    }
+
+    public void setWp_url(String wp_url) {
+        this.wp_url = wp_url;
+    }
+
+    public String getWp_href() {
+        return wp_href;
+    }
+
+    public void setWp_href(String wp_href) {
+        this.wp_href = wp_href;
+    }
+
+    public String getWp_startdate() {
+        return wp_startdate;
+    }
+
+    public void setWp_startdate(String wp_startdate) {
+        this.wp_startdate = wp_startdate;
+    }
+
+    public String getWp_enddate() {
+        return wp_enddate;
+    }
+
+    public void setWp_enddate(String wp_enddate) {
+        this.wp_enddate = wp_enddate;
+    }
 }
 }

+ 47 - 45
src/main/resources/mybatis/mapper/wxmini/WXPromotionMapper.xml

@@ -1,46 +1,48 @@
-<?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.ygj.yuemum.dao.wxmini.WXPromotionDao" >
-
-    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.wxmini.WXPromotion" >
-        <id column="id" property="id" jdbcType="INTEGER" />
-        <result column="wp_name" property="wp_name" jdbcType="VARCHAR" />
-        <result column="wp_desc" property="wp_desc" jdbcType="VARCHAR" />
-        <result column="wp_url" property="wp_url" jdbcType="VARCHAR" />
-        <result column="wp_index_url" property="wp_index_url" jdbcType="VARCHAR" />
-        <result column="wp_href" property="wp_href" jdbcType="VARCHAR" />
-        <result column="wp_startdate" property="wp_startdate" jdbcType="DATE" />
-        <result column="wp_enddate" property="wp_enddate" jdbcType="DATE" />
-    </resultMap>
-
-    <!--获取所有数据-->
-    <select id="getPromotions" resultType="com.ygj.yuemum.domain.wxmini.WXPromotion" >
-        SELECT
-        id,
-        wp_name,
-        wp_desc,
-        wp_url,
-        wp_href,
-        DATE_FORMAT(wp_startdate, '%Y/%m/%d') wp_startdate,
-        DATE_FORMAT(wp_enddate, '%Y/%m/%d') wp_enddate,
-        if(TO_DAYS(NOW()) - TO_DAYS(wp_enddate) &lt;= 0,'Y','N') wp_isexpire
-        FROM
-        wx_promotion
-        ORDER BY
-        id DESC
-    </select>
-
-    <select id="getIndexPromotions" resultType="com.ygj.yuemum.domain.wxmini.WXPromotion" >
-        SELECT
-        *
-        FROM
-        wx_promotion
-        WHERE
-        DATE_FORMAT(now(), '%Y-%m-%d') &gt;= DATE_FORMAT(wp_startdate, '%Y-%m-%d')
-        AND DATE_FORMAT(now(), '%Y-%m-%d') &lt;= DATE_FORMAT(wp_enddate, '%Y-%m-%d')
-        ORDER BY
-        id DESC
-        LIMIT 6
-    </select>
-
+<?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.ygj.yuemum.dao.wxmini.WXPromotionDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.wxmini.WXPromotion" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="wp_name" property="wp_name" jdbcType="VARCHAR" />
+        <result column="wp_desc" property="wp_desc" jdbcType="VARCHAR" />
+        <result column="wp_url" property="wp_url" jdbcType="VARCHAR" />
+        <result column="wp_index_url" property="wp_index_url" jdbcType="VARCHAR" />
+        <result column="wp_href" property="wp_href" jdbcType="VARCHAR" />
+        <result column="wp_startdate" property="wp_startdate" jdbcType="DATE" />
+        <result column="wp_enddate" property="wp_enddate" jdbcType="DATE" />
+        <result column="wp_type" property="wp_type" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--获取所有数据-->
+    <select id="getPromotions" resultType="com.ygj.yuemum.domain.wxmini.WXPromotion" >
+        SELECT
+        id,
+        wp_name,
+        wp_desc,
+        wp_url,
+        wp_href,
+        DATE_FORMAT(wp_startdate, '%Y/%m/%d') wp_startdate,
+        DATE_FORMAT(wp_enddate, '%Y/%m/%d') wp_enddate,
+        if(TO_DAYS(NOW()) - TO_DAYS(wp_enddate) &lt;= 0,'Y','N') wp_isexpire,
+        wp_type
+        FROM
+        wx_promotion
+        ORDER BY
+        id DESC
+    </select>
+
+    <select id="getIndexPromotions" resultType="com.ygj.yuemum.domain.wxmini.WXPromotion" >
+        SELECT
+        *
+        FROM
+        wx_promotion
+        WHERE
+        DATE_FORMAT(now(), '%Y-%m-%d') &gt;= DATE_FORMAT(wp_startdate, '%Y-%m-%d')
+        AND DATE_FORMAT(now(), '%Y-%m-%d') &lt;= DATE_FORMAT(wp_enddate, '%Y-%m-%d')
+        ORDER BY
+        id DESC
+        LIMIT 6
+    </select>
+
 </mapper>
 </mapper>