1
0
xinmu_server 7 лет назад
Родитель
Сommit
7c4ac61ae7

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestCaidan;
+
+
+/**
+*  Dao接口
+*/
+@DataSource("dataSourceSqlserver")
+@Repository("com.zoumaframe.dao.TestCaidanMapper")
+public interface TestCaidanMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestCaidan record);
+
+    TestCaidan selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestCaidan record);
+
+    List<TestCaidan> queryAllTestCaidan(TestCaidan record);
+
+    List<TestCaidan> queryTestCaidanByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestCaidan queryTestCaidan(TestCaidan record);
+
+    List<TestCaidan> query(TestCaidan record);
+}
+

+ 287 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.xml

@@ -0,0 +1,287 @@
+<?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.izouma.awesomeadmin.dao.TestCaidanMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestCaidan">
+                                                <result column="SequenceID" property="sequenceid" jdbcType="INTEGER"/>
+                                                <id column="id" property="id" jdbcType="INTEGER"/>
+                                                                        <result column="CaiDanXiangMing" property="caidanxiangming" jdbcType="VARCHAR"/>
+                                                            <result column="CaiDanCiXu" property="caidancixu" jdbcType="SMALLINT"/>
+                                                            <result column="URL" property="url" jdbcType="VARCHAR"/>
+                                                            <result column="CaiDanShuoMing" property="caidanshuoming" jdbcType="VARCHAR"/>
+                                                            <result column="ChuFaTiaoJian" property="chufatiaojian" jdbcType="VARCHAR"/>
+                        </resultMap>
+    <sql id="Base_Column_List">
+                    SequenceID,                    ID,                    CaiDanXiangMing,                    CaiDanCiXu,                    URL,                    CaiDanShuoMing,                    ChuFaTiaoJian            </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestCaidan"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into CaiDan_Table
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                                                <if test="sequenceid!= null">
+                        SequenceID,
+                    </if>
+                                                                                            <if test="caidanxiangming!= null">
+                        CaiDanXiangMing,
+                    </if>
+                                                                <if test="caidancixu!= null">
+                        CaiDanCiXu,
+                    </if>
+                                                                <if test="url!= null">
+                        URL,
+                    </if>
+                                                                <if test="caidanshuoming!= null">
+                        CaiDanShuoMing,
+                    </if>
+                                                                <if test="chufatiaojian!= null">
+                        ChuFaTiaoJian,
+                    </if>
+                                    </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                                                <if test="sequenceid != null">
+                        #{sequenceid,jdbcType=INTEGER},
+                    </if>
+                                                                                            <if test="caidanxiangming != null">
+                        #{caidanxiangming,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="caidancixu != null">
+                        #{caidancixu,jdbcType=SMALLINT},
+                    </if>
+                                                                <if test="url != null">
+                        #{url,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="caidanshuoming != null">
+                        #{caidanshuoming,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="chufatiaojian != null">
+                        #{chufatiaojian,jdbcType=VARCHAR},
+                    </if>
+                                    </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestCaidan">
+        update CaiDan_Table
+        <set>
+                                                <if test="sequenceid != null">
+                        SequenceID= #{sequenceid,jdbcType=INTEGER},
+                    </if>
+                                                                                            <if test="caidanxiangming != null">
+                        CaiDanXiangMing= #{caidanxiangming,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="caidancixu != null">
+                        CaiDanCiXu= #{caidancixu,jdbcType=SMALLINT},
+                    </if>
+                                                                <if test="url != null">
+                        URL= #{url,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="caidanshuoming != null">
+                        CaiDanShuoMing= #{caidanshuoming,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="chufatiaojian != null">
+                        ChuFaTiaoJian= #{chufatiaojian,jdbcType=VARCHAR},
+                    </if>
+                                    </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestCaidanByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+                            <if test="record.sequenceid != null and !&quot;&quot;.equals(record.sequenceid)">
+                    and  SequenceID = #{record.sequenceid}
+                </if>
+                            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                    and  ID = #{record.id}
+                </if>
+                            <if test="record.caidanxiangming != null and !&quot;&quot;.equals(record.caidanxiangming)">
+                    and  CaiDanXiangMing = #{record.caidanxiangming}
+                </if>
+                            <if test="record.caidancixu != null and !&quot;&quot;.equals(record.caidancixu)">
+                    and  CaiDanCiXu = #{record.caidancixu}
+                </if>
+                            <if test="record.url != null and !&quot;&quot;.equals(record.url)">
+                    and  URL = #{record.url}
+                </if>
+                            <if test="record.caidanshuoming != null and !&quot;&quot;.equals(record.caidanshuoming)">
+                    and  CaiDanShuoMing = #{record.caidanshuoming}
+                </if>
+                            <if test="record.chufatiaojian != null and !&quot;&quot;.equals(record.chufatiaojian)">
+                    and  ChuFaTiaoJian = #{record.chufatiaojian}
+                </if>
+            
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  CaiDanXiangMing LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                                                                                                                        OR  URL LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                        OR  CaiDanShuoMing LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                        OR  ChuFaTiaoJian LIKE concat('%',#{record.searchKey},'%')
+                                                                                        </trim>
+            </if>
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestCaidan" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+                            <if test="sequenceid != null and !&quot;&quot;.equals(sequenceid)">
+                    and  SequenceID = #{sequenceid}
+                </if>
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and  ID = #{id}
+                </if>
+                            <if test="caidanxiangming != null and !&quot;&quot;.equals(caidanxiangming)">
+                    and  CaiDanXiangMing = #{caidanxiangming}
+                </if>
+                            <if test="caidancixu != null and !&quot;&quot;.equals(caidancixu)">
+                    and  CaiDanCiXu = #{caidancixu}
+                </if>
+                            <if test="url != null and !&quot;&quot;.equals(url)">
+                    and  URL = #{url}
+                </if>
+                            <if test="caidanshuoming != null and !&quot;&quot;.equals(caidanshuoming)">
+                    and  CaiDanShuoMing = #{caidanshuoming}
+                </if>
+                            <if test="chufatiaojian != null and !&quot;&quot;.equals(chufatiaojian)">
+                    and  ChuFaTiaoJian = #{chufatiaojian}
+                </if>
+            
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  CaiDanXiangMing LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                                                                                                                        OR  URL LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  CaiDanShuoMing LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  ChuFaTiaoJian LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestCaidan" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select top 1
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+                            <if test="sequenceid != null and !&quot;&quot;.equals(sequenceid)">
+                    and SequenceID = #{sequenceid}
+                </if>
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and ID = #{id}
+                </if>
+                            <if test="caidanxiangming != null and !&quot;&quot;.equals(caidanxiangming)">
+                    and CaiDanXiangMing = #{caidanxiangming}
+                </if>
+                            <if test="caidancixu != null and !&quot;&quot;.equals(caidancixu)">
+                    and CaiDanCiXu = #{caidancixu}
+                </if>
+                            <if test="url != null and !&quot;&quot;.equals(url)">
+                    and URL = #{url}
+                </if>
+                            <if test="caidanshuoming != null and !&quot;&quot;.equals(caidanshuoming)">
+                    and CaiDanShuoMing = #{caidanshuoming}
+                </if>
+                            <if test="chufatiaojian != null and !&quot;&quot;.equals(chufatiaojian)">
+                    and ChuFaTiaoJian = #{chufatiaojian}
+                </if>
+            
+        </where>
+    </select>
+    <delete id="delete">
+        delete from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 106 - 0
src/main/java/com/izouma/awesomeadmin/model/TestCaidan.java

@@ -0,0 +1,106 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TestCaidan{
+    private Integer sequenceid;
+    private String id;
+    private String caidanxiangming;
+    private short caidancixu;
+    private String url;
+    private String caidanshuoming;
+    private String chufatiaojian;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+/**
+* column_name_,desc_;column_name_,asc
+*/
+private String orderByStr;
+
+    public Integer getSequenceid(){
+        return this.sequenceid;
+    }
+
+    public void setSequenceid(Integer sequenceid){
+        this.sequenceid = sequenceid;
+    }
+    public String getId(){
+        return this.id;
+    }
+
+    public void setId(String id){
+        this.id = id;
+    }
+    public String getCaidanxiangming(){
+        return this.caidanxiangming;
+    }
+
+    public void setCaidanxiangming(String caidanxiangming){
+        this.caidanxiangming = caidanxiangming;
+    }
+    public short getCaidancixu(){
+        return this.caidancixu;
+    }
+
+    public void setCaidancixu(short caidancixu){
+        this.caidancixu = caidancixu;
+    }
+    public String getUrl(){
+        return this.url;
+    }
+
+    public void setUrl(String url){
+        this.url = url;
+    }
+    public String getCaidanshuoming(){
+        return this.caidanshuoming;
+    }
+
+    public void setCaidanshuoming(String caidanshuoming){
+        this.caidanshuoming = caidanshuoming;
+    }
+    public String getChufatiaojian(){
+        return this.chufatiaojian;
+    }
+
+    public void setChufatiaojian(String chufatiaojian){
+        this.chufatiaojian = chufatiaojian;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+public String getOrderByStr() {
+    return orderByStr;
+}
+
+public void setOrderByStr(String orderByStr) {
+    this.orderByStr = orderByStr;
+}
+
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/TestCaidanService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestCaidan;
+
+
+/**
+*  service接口类
+*/
+public interface TestCaidanService{
+
+    List<TestCaidan> getTestCaidanList(TestCaidan record);
+
+    List<TestCaidan> getTestCaidanByPage(Page page, TestCaidan record);
+
+    TestCaidan getTestCaidanById(String id);
+
+    TestCaidan getTestCaidan(TestCaidan record);
+
+    boolean createTestCaidan(TestCaidan record);
+
+    boolean deleteTestCaidan(String id);
+
+    boolean updateTestCaidan(TestCaidan record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/TestCaidanServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestCaidan;
+import com.izouma.awesomeadmin.service.TestCaidanService;
+import com.izouma.awesomeadmin.dao.TestCaidanMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestCaidanServiceImpl implements TestCaidanService{
+
+    private static Logger logger = Logger.getLogger(TestCaidanServiceImpl.class);
+
+    @Autowired
+    private TestCaidanMapper testCaidanMapper;
+
+    @Override
+    public List<TestCaidan> getTestCaidanList(TestCaidan record) {
+
+        logger.info("getTestCaidanList");
+        try {
+
+        return testCaidanMapper.queryAllTestCaidan(record);
+        } catch (Exception e) {
+        logger.error("getTestCaidanList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<TestCaidan> getTestCaidanByPage(Page page, TestCaidan record) {
+
+        logger.info("getTestCaidanByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testCaidanMapper.queryTestCaidanByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestCaidanByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestCaidan getTestCaidanById(String id) {
+
+        logger.info("getTestCaidanyId");
+        try {
+
+            return testCaidanMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestCaidanById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestCaidan getTestCaidan(TestCaidan record) {
+
+        logger.info("getTestCaidan");
+        try {
+
+            return testCaidanMapper.queryTestCaidan(record);
+        } catch (Exception e) {
+        logger.error("getTestCaidan", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestCaidan(TestCaidan record) {
+
+        logger.info("createTestCaidan");
+        try {
+
+            int updates = testCaidanMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestCaidan", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestCaidan(String id) {
+
+        logger.info("deleteTestCaidan");
+        try {
+
+             int updates = testCaidanMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestCaidan", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestCaidan(TestCaidan record) {
+
+        logger.info("updateTestCaidan");
+        try {
+
+            int updates = testCaidanMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestCaidan", e);
+        }
+
+        return false;
+    }
+}
+

+ 158 - 0
src/main/java/com/izouma/awesomeadmin/web/TestCaidanController.java

@@ -0,0 +1,158 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.TestCaidan;
+import com.izouma.awesomeadmin.service.TestCaidanService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/testCaidan")
+public class TestCaidanController extends BaseController{
+
+    @Autowired
+    private TestCaidanService testCaidanService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(TestCaidan record) {
+        List<TestCaidan> pp = testCaidanService.getTestCaidanList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getTestCaidan", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getTestCaidan(@RequestParam(required = false, value = "id") String id) {
+        TestCaidan data = testCaidanService.getTestCaidanById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(TestCaidan record) {
+        TestCaidan data = testCaidanService.getTestCaidan(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, TestCaidan record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<TestCaidan> pp =testCaidanService.getTestCaidanByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(TestCaidan record) {
+        boolean num = testCaidanService.createTestCaidan(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateTestCaidan(TestCaidan record) {
+        boolean num = testCaidanService.updateTestCaidan(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteTestCaidan(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = testCaidanService.deleteTestCaidan(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, TestCaidan record) throws Exception {
+
+    List<TestCaidan> testCaidans = testCaidanService.getTestCaidanList(record);
+
+
+        String sheetName = "CaiDan_Table";
+        String titleName = "caidan数据表";
+        String fileName = "caidan表";
+        int columnNumber = 7;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "SequenceID" ,   "ID" ,   "CaiDanXiangMing" ,   "CaiDanCiXu" ,   "URL" ,   "CaiDanShuoMing" ,   "ChuFaTiaoJian"  };
+        String[][] dataList = new String[testCaidans.size()][7];
+
+        for (int i = 0; i < testCaidans.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(testCaidans.get(i).getSequenceid());
+                        dataList[i][1] = String.valueOf(testCaidans.get(i).getId());
+                        dataList[i][2] = String.valueOf(testCaidans.get(i).getCaidanxiangming());
+                        dataList[i][3] = String.valueOf(testCaidans.get(i).getCaidancixu());
+                        dataList[i][4] = String.valueOf(testCaidans.get(i).getUrl());
+                        dataList[i][5] = String.valueOf(testCaidans.get(i).getCaidanshuoming());
+                        dataList[i][6] = String.valueOf(testCaidans.get(i).getChufatiaojian());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 108 - 0
src/main/vue/src/pages/TestCaidan.vue

@@ -0,0 +1,108 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                            <el-form-item prop="sequenceid" label="SequenceID">
+                <el-input v-model="formData.sequenceid"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="id" label="ID">
+                <el-input v-model="formData.id"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="caidanxiangming" label="CaiDanXiangMing">
+                <el-input v-model="formData.caidanxiangming"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="caidancixu" label="CaiDanCiXu">
+                <el-input v-model="formData.caidancixu"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="url" label="URL">
+                <el-input v-model="formData.url"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="caidanshuoming" label="CaiDanShuoMing">
+                <el-input v-model="formData.caidanshuoming"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="chufatiaojian" label="ChuFaTiaoJian">
+                <el-input v-model="formData.chufatiaojian"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                        <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/testCaidan/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+
+                                                                                                                                                                                                                                                                                                                                                                                                    
+                        this.formData = res.data;
+                    }
+                })
+            }
+
+                                                                                                                                                                                                                        },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                                                                                                        },
+                                                                }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/testCaidan/update' : '/testCaidan/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testCaidan/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 494 - 0
src/main/vue/src/pages/TestCaidans.vue

@@ -0,0 +1,494 @@
+<template>
+    <div>
+        <div class="filters-container">
+        
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
+                       icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
+                       icon="el-icon-sort" class="filter-item">排序
+            </el-button>
+            <el-button @click="$router.push('/testCaidan')" type="primary"
+                       size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                            
+                                            <el-table-column
+                                v-if="isColumnShow('sequenceid')"
+                                prop="sequenceid"
+                                label="SequenceID"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('id')"
+                                prop="id"
+                                label="ID"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('caidanxiangming')"
+                                prop="caidanxiangming"
+                                label="CaiDanXiangMing"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('caidancixu')"
+                                prop="caidancixu"
+                                label="CaiDanCiXu"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('url')"
+                                prop="url"
+                                label="URL"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('caidanshuoming')"
+                                prop="caidanshuoming"
+                                label="CaiDanShuoMing"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('chufatiaojian')"
+                                prop="chufatiaojian"
+                                label="ChuFaTiaoJian"
+                                min-width="100">
+                        </el-table-column>
+                                                            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item"
+                                       :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="排序" :visible.sync="showTableSortDialog">
+            <el-button @click="addSortField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="tableSortFields">
+
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="order" label="排序" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.order">
+                            <el-option label="降序" value="desc">
+                            </el-option>
+                            <el-option label="升序" value="asc">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeSortField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="tableSortQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="查看图片" :visible.sync="imageDialogVisible" size="small">
+            <img width="100%" :src="imgSrc" alt="">
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+    import {format} from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                        {
+                                label: 'SequenceID',
+                                value: 'sequenceid',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'ID',
+                                value: 'id',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'CaiDanXiangMing',
+                                value: 'caidanxiangming',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'CaiDanCiXu',
+                                value: 'caidancixu',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'URL',
+                                value: 'url',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'CaiDanShuoMing',
+                                value: 'caidanshuoming',
+                                show: true
+                            },
+                                                                                                {
+                                label: 'ChuFaTiaoJian',
+                                value: 'chufatiaojian',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                        {
+                                label: 'SequenceID',
+                                value: 'SequenceID'
+                            },
+                                                                                                {
+                                label: 'ID',
+                                value: 'ID'
+                            },
+                                                                                                {
+                                label: 'CaiDanXiangMing',
+                                value: 'CaiDanXiangMing'
+                            },
+                                                                                                {
+                                label: 'CaiDanCiXu',
+                                value: 'CaiDanCiXu'
+                            },
+                                                                                                {
+                                label: 'URL',
+                                value: 'URL'
+                            },
+                                                                                                {
+                                label: 'CaiDanShuoMing',
+                                value: 'CaiDanShuoMing'
+                            },
+                                                                                                {
+                                label: 'ChuFaTiaoJian',
+                                value: 'ChuFaTiaoJian'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+                orderByStr: '',
+                imgSrc: '',
+                imageDialogVisible: false,
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
+                    url: '/testCaidan/page',
+                    data: {
+                        currentPage: this.currentPage,
+                        pageNumber: this.pageSize,
+                        searchKey: this.filter1,
+                        advancedQuery: this.advancedQuerySearchKey,
+                        orderByStr: this.orderByStr,
+                    }
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testCaidan',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            addSortField() {
+                this.tableSortFields.push({
+                    name: '',
+                    order: 'asc',
+                });
+            },
+            removeSortField(i) {
+                if (this.tableSortFields.length > 0) {
+                    this.tableSortFields.splice(i, 1);
+                }
+            },
+            tableSortQuery() {
+
+                this.orderByStr = '';
+
+                if (this.tableSortFields.length > 0) {
+
+                    var templist = [];
+
+                    this.tableSortFields.forEach(item => {
+                        if (item.name && item.order) {
+                            var tempItem = item.name + '_,' + item.order;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.orderByStr = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showTableSortDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testCaidan/exportExcel?searchKey="
+                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post({
+                        url: '/testCaidan/del',
+                        data: {id: row.id}
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+            DateTimeFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+                }
+
+            },
+            DateFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+                }
+
+            },
+            showImg(img) {
+                this.imgSrc = img;
+                this.imageDialogVisible = true;
+            },
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 10 - 0
src/main/vue/src/router/index.js

@@ -259,6 +259,16 @@ const router = new Router({
                     path: '/testgits',
                     name: 'Testgits',
                     component: () => import('../pages/Testgits')
+                },
+                {
+                    path: '/testCaidan',
+                    name: 'TestCaidan',
+                    component: () => import('../pages/TestCaidan')
+                },
+                {
+                    path: '/testCaidans',
+                    name: 'TestCaidans',
+                    component: () => import('../pages/TestCaidans')
                 }
                 /**INSERT_LOCATION**/
             ]

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/manifest.934591bb531f22106656.js.map


Некоторые файлы не были показаны из-за большого количества измененных файлов