x1ongzhu il y a 7 ans
Parent
commit
58e9ca188f

+ 25 - 5
src/main/java/com/izouma/awesomeadmin/dao/CompetitionMapper.xml

@@ -15,13 +15,13 @@
         <result column="type" property="type" jdbcType="INTEGER"/>
         <result column="bonus" property="bonus" jdbcType="INTEGER"/>
         <result column="status" property="status" jdbcType="INTEGER"/>
+        <result column="intro" property="intro" jdbcType="VARCHAR"/>
         <!--generatedEnd-->
     </resultMap>
 
     <sql id="Base_Column_List">
         <!--generatedStart-->
-        id, del_flag, update_time, update_user, create_time, create_user, competition_name, start_time, end_time, type,
-        bonus, status        <!--generatedEnd-->
+        id, del_flag, update_time, update_user, create_time, create_user, competition_name, start_time, end_time, type, bonus, status, intro        <!--generatedEnd-->
     </sql>
 
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -78,6 +78,9 @@
             <if test="status!= null">
                 status,
             </if>
+            <if test="intro!= null">
+                intro,
+            </if>
             <!--generatedEnd-->
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -118,6 +121,9 @@
             <if test="status != null">
                 #{status,jdbcType=INTEGER},
             </if>
+            <if test="intro != null">
+                #{intro,jdbcType=VARCHAR},
+            </if>
             <!--generatedEnd-->
         </trim>
     </insert>
@@ -162,6 +168,9 @@
             <if test="status != null">
                 status= #{status,jdbcType=INTEGER},
             </if>
+            <if test="intro != null">
+                intro= #{intro,jdbcType=VARCHAR},
+            </if>
             <!--generatedEnd-->
         </set>
         WHERE
@@ -218,7 +227,10 @@
                 AND bonus = #{record.bonus}
             </if>
             <if test="record.status != null and !&quot;&quot;.equals(record.status)">
-                AND status in (${record.status})
+                AND status = #{record.status}
+            </if>
+            <if test="record.intro != null and !&quot;&quot;.equals(record.intro)">
+                AND intro = #{record.intro}
             </if>
             <!--generatedEnd-->
             <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
@@ -228,6 +240,7 @@
                     OR type LIKE concat('%',#{record.searchKey},'%')
                     OR bonus LIKE concat('%',#{record.searchKey},'%')
                     OR status LIKE concat('%',#{record.searchKey},'%')
+                    OR intro LIKE concat('%',#{record.searchKey},'%')
                     <!--generatedEnd-->
                 </trim>
             </if>
@@ -318,7 +331,10 @@
                 AND bonus = #{bonus}
             </if>
             <if test="status != null and !&quot;&quot;.equals(status)">
-                AND status in (${status})
+                AND status = #{status}
+            </if>
+            <if test="intro != null and !&quot;&quot;.equals(intro)">
+                AND intro = #{intro}
             </if>
             <!--generatedEnd-->
             <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
@@ -328,6 +344,7 @@
                     OR type LIKE concat('%',#{searchKey},'%')
                     OR bonus LIKE concat('%',#{searchKey},'%')
                     OR status LIKE concat('%',#{searchKey},'%')
+                    OR intro LIKE concat('%',#{searchKey},'%')
                     <!--generatedEnd-->
                 </trim>
             </if>
@@ -413,7 +430,10 @@
                 AND bonus = #{bonus}
             </if>
             <if test="status != null and !&quot;&quot;.equals(status)">
-                AND status in (${status})
+                AND status = #{status}
+            </if>
+            <if test="intro != null and !&quot;&quot;.equals(intro)">
+                AND intro = #{intro}
             </if>
             <!--generatedEnd-->
         </where>

+ 44 - 47
src/main/java/com/izouma/awesomeadmin/model/Competition.java

@@ -11,131 +11,128 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 public class Competition {
     /*generatedStart*/
     private Integer id;
-    private String  delFlag;
-    private Date    updateTime;
-    private String  updateUser;
-    private Date    createTime;
-    private String  createUser;
-    private String  competitionName;
-    private Date    startTime;
-    private Date    endTime;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private String competitionName;
+    private Date startTime;
+    private Date endTime;
     private Integer type;
     private Integer bonus;
     private Integer status;
+    private String intro;
 
     private String idStr;
 
     private String searchKey;
 
     /**
-     * and,test_name,like,value;or,remark,=,123
-     */
+    * and,test_name,like,value;or,remark,=,123
+    */
     private String advancedQuery;
 
     /**
-     * column_name_,desc_;column_name_,asc
-     */
+    * column_name_,desc_;column_name_,asc
+    */
     private String orderByStr;
     /*generatedEnd*/
 
     private ParticipatingInfo participatingInfo;
 
     /*generatedStart*/
-    public Integer getId() {
+    public Integer getId(){
         return this.id;
     }
 
-    public void setId(Integer id) {
+    public void setId(Integer id){
         this.id = id;
     }
-
-    public String getDelFlag() {
+    public String getDelFlag(){
         return this.delFlag;
     }
 
-    public void setDelFlag(String delFlag) {
+    public void setDelFlag(String delFlag){
         this.delFlag = delFlag;
     }
-
-    public Date getUpdateTime() {
+    public Date getUpdateTime(){
         return this.updateTime;
     }
 
-    public void setUpdateTime(Date updateTime) {
+    public void setUpdateTime(Date updateTime){
         this.updateTime = updateTime;
     }
-
-    public String getUpdateUser() {
+    public String getUpdateUser(){
         return this.updateUser;
     }
 
-    public void setUpdateUser(String updateUser) {
+    public void setUpdateUser(String updateUser){
         this.updateUser = updateUser;
     }
-
-    public Date getCreateTime() {
+    public Date getCreateTime(){
         return this.createTime;
     }
 
-    public void setCreateTime(Date createTime) {
+    public void setCreateTime(Date createTime){
         this.createTime = createTime;
     }
-
-    public String getCreateUser() {
+    public String getCreateUser(){
         return this.createUser;
     }
 
-    public void setCreateUser(String createUser) {
+    public void setCreateUser(String createUser){
         this.createUser = createUser;
     }
-
-    public String getCompetitionName() {
+    public String getCompetitionName(){
         return this.competitionName;
     }
 
-    public void setCompetitionName(String competitionName) {
+    public void setCompetitionName(String competitionName){
         this.competitionName = competitionName;
     }
-
-    public Date getStartTime() {
+    public Date getStartTime(){
         return this.startTime;
     }
 
-    public void setStartTime(Date startTime) {
+    public void setStartTime(Date startTime){
         this.startTime = startTime;
     }
-
-    public Date getEndTime() {
+    public Date getEndTime(){
         return this.endTime;
     }
 
-    public void setEndTime(Date endTime) {
+    public void setEndTime(Date endTime){
         this.endTime = endTime;
     }
-
-    public Integer getType() {
+    public Integer getType(){
         return this.type;
     }
 
-    public void setType(Integer type) {
+    public void setType(Integer type){
         this.type = type;
     }
-
-    public Integer getBonus() {
+    public Integer getBonus(){
         return this.bonus;
     }
 
-    public void setBonus(Integer bonus) {
+    public void setBonus(Integer bonus){
         this.bonus = bonus;
     }
-
-    public Integer getStatus() {
+    public Integer getStatus(){
         return this.status;
     }
 
-    public void setStatus(Integer status) {
+    public void setStatus(Integer status){
         this.status = status;
     }
+    public String getIntro(){
+        return this.intro;
+    }
+
+    public void setIntro(String intro){
+        this.intro = intro;
+    }
 
     public String getSearchKey() {
         return searchKey;

+ 22 - 21
src/main/java/com/izouma/awesomeadmin/web/CompetitionController.java

@@ -55,7 +55,7 @@ public class CompetitionController {
     public Result page(Page page, Competition record) {
         Map<String, Object> result = new HashMap<>();
 
-        List<Competition> pp = competitionService.getCompetitionByPage(page, record);
+        List<Competition> pp =competitionService.getCompetitionByPage(page, record);
 
         result.put(AppConstant.PAGE, page);
         result.put("pp", pp);
@@ -67,7 +67,7 @@ public class CompetitionController {
     public Result save(Competition record) {
         boolean num = competitionService.createCompetition(record);
         if (num) {
-            return new Result(true, record.getId());
+        return new Result(true, record.getId());
         }
         return new Result(false, "保存异常");
     }
@@ -77,7 +77,7 @@ public class CompetitionController {
     public Result updateCompetition(Competition record) {
         boolean num = competitionService.updateCompetition(record);
         if (num) {
-            return new Result(true, "保存成功");
+        return new Result(true, "保存成功");
         }
         return new Result(false, "保存异常");
     }
@@ -88,7 +88,7 @@ public class CompetitionController {
 
         boolean num = competitionService.deleteCompetition(record);
         if (num) {
-            return new Result(true, "删除成功");
+        return new Result(true, "删除成功");
         }
         return new Result(false, "删除异常");
     }
@@ -102,25 +102,26 @@ public class CompetitionController {
         String sheetName = "competition";
         String titleName = "赛事数据表";
         String fileName = "赛事表";
-        int columnNumber = 12;
-        int[] columnWidth = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
-        String[] columnName = {"", "删除标识", "更新时间", "更新人", "创建时间", "创建人", "赛事名称", "开始时间", "结束时间", "赛事类型", "奖金", "状态"};
-        String[][] dataList = new String[competitions.size()][12];
+        int columnNumber = 13;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "赛事名称" ,   "开始时间" ,   "结束时间" ,   "赛事类型" ,   "奖金" ,   "状态" ,   "介绍"  };
+        String[][] dataList = new String[competitions.size()][13];
 
         for (int i = 0; i < competitions.size(); i++) {
-            dataList[i][0] = String.valueOf(competitions.get(i).getId());
-            dataList[i][1] = String.valueOf(competitions.get(i).getDelFlag());
-            dataList[i][2] = String.valueOf(competitions.get(i).getUpdateTime());
-            dataList[i][3] = String.valueOf(competitions.get(i).getUpdateUser());
-            dataList[i][4] = String.valueOf(competitions.get(i).getCreateTime());
-            dataList[i][5] = String.valueOf(competitions.get(i).getCreateUser());
-            dataList[i][6] = String.valueOf(competitions.get(i).getCompetitionName());
-            dataList[i][7] = String.valueOf(competitions.get(i).getStartTime());
-            dataList[i][8] = String.valueOf(competitions.get(i).getEndTime());
-            dataList[i][9] = String.valueOf(competitions.get(i).getType());
-            dataList[i][10] = String.valueOf(competitions.get(i).getBonus());
-            dataList[i][11] = String.valueOf(competitions.get(i).getStatus());
-        }
+                        dataList[i][0] = String.valueOf(competitions.get(i).getId());
+                        dataList[i][1] = String.valueOf(competitions.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(competitions.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(competitions.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(competitions.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(competitions.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(competitions.get(i).getCompetitionName());
+                        dataList[i][7] = String.valueOf(competitions.get(i).getStartTime());
+                        dataList[i][8] = String.valueOf(competitions.get(i).getEndTime());
+                        dataList[i][9] = String.valueOf(competitions.get(i).getType());
+                        dataList[i][10] = String.valueOf(competitions.get(i).getBonus());
+                        dataList[i][11] = String.valueOf(competitions.get(i).getStatus());
+                        dataList[i][12] = String.valueOf(competitions.get(i).getIntro());
+                    }
 
         ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
                 columnNumber, columnWidth, columnName, dataList, response);

+ 6 - 3
src/main/vue/src/pages/Competition.vue

@@ -58,6 +58,9 @@
                     </el-select>
                 </template>
             </el-form-item>
+            <el-form-item prop="intro" label="介绍">
+                <el-input v-model="formData.intro" :disabled="'intro'==subColumn"></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>
@@ -89,7 +92,7 @@
                     }
                 }).then(res => {
                     if (res.success) {
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                this.formData = res.data;
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            this.formData = res.data;
                         if (this.$route.query.column) {
                             this.formData[this.subColumn] = this.subValue;
                         }
@@ -101,7 +104,7 @@
                 }
             }
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    },
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                },
         data() {
             return {
                 saving: false,
@@ -178,7 +181,7 @@
             submit() {
                 let data = {...this.formData};
 
-                                                                                                                                                                                                                
+                                                                                                                                                                                                                                
                 this.$http.post({
                     url: this.formData.id ? '/competition/update' : '/competition/save',
                     data: data

+ 16 - 0
src/main/vue/src/pages/Competitions.vue

@@ -87,6 +87,13 @@
                                 label="状态"
                                 min-width="100">
                         </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('intro')"
+                                prop="intro"
+                                label="介绍"
+                                min-width="100">
+                        </el-table-column>
                                                             <el-table-column
                     label="操作"
                     align="center"
@@ -259,6 +266,11 @@
                                 label: '状态',
                                 value: 'status',
                                 show: true
+                            },
+                                                                                                {
+                                label: '介绍',
+                                value: 'intro',
+                                show: true
                             },
                                                             ],
                 multipleMode: false,
@@ -291,6 +303,10 @@
                                                                                                 {
                                 label: '状态',
                                 value: 'status'
+                            },
+                                                                                                {
+                                label: '介绍',
+                                value: 'intro'
                             },
                                                             ],
                 advancedQuerySearchKey: '',