zouxuan 5 年之前
父节点
当前提交
2f90281985

+ 1 - 1
edu-common/src/main/resources/config.mybatis/SysConfigMapper.xml

@@ -1,7 +1,7 @@
 <?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.keao.edu.common.dal.dao.SysConfigDao">
+<mapper namespace="com.keao.edu.user.dao.SysConfigDao">
 
 	<resultMap type="com.keao.edu.common.entity.SysConfig" id="SysConfig">
 		<result column="id_" property="id" />

+ 5 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/AgencyController.java

@@ -2,8 +2,10 @@ package com.keao.edu.user.controller;
 
 
 import com.keao.edu.common.controller.BaseController;
-import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.user.entity.Agency;
+import com.keao.edu.user.page.AgencyQueryInfo;
 import com.keao.edu.user.service.AgencyService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -28,7 +30,7 @@ public class AgencyController extends BaseController {
 	@ApiOperation(value = "参数列表")
 	@GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('agency/list')")
-	public Object configList(QueryInfo queryInfo) {
+	public HttpResponseResult<PageInfo<Agency>> configList(AgencyQueryInfo queryInfo) {
 		return succeed(agencyService.queryPage(queryInfo));
 	}
 
@@ -50,7 +52,7 @@ public class AgencyController extends BaseController {
 	@ApiOperation(value = "查询参数")
 	@GetMapping(value = "get")
     @PreAuthorize("@pcs.hasPermissions('agency/get')")
-	public Object getConfig(Integer id) {
+	public HttpResponseResult<Agency> getConfig(Integer id) {
 		return succeed(agencyService.get(id));
 	}
 }

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SysConfigController.java

@@ -3,7 +3,7 @@ package com.keao.edu.user.controller;
 
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.SysConfig;
-import com.keao.edu.common.service.SysConfigService;
+import com.keao.edu.user.service.SysConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;

+ 1 - 1
edu-common/src/main/java/com/keao/edu/common/dal/dao/SysConfigDao.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/SysConfigDao.java

@@ -1,4 +1,4 @@
-package com.keao.edu.common.dal.dao;
+package com.keao.edu.user.dao;
 
 
 import com.keao.edu.common.dal.BaseDAO;

+ 22 - 9
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Agency.java

@@ -1,5 +1,6 @@
 package com.keao.edu.user.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -9,20 +10,21 @@ public class Agency {
 
 	/**  */
 	private Integer id;
-	
-	/**  */
+
+	@ApiModelProperty(value = "代理商名字",required = false)
 	private String name;
-	
-	/**  */
+
+	@ApiModelProperty(value = "联系人名字",required = false)
 	private String contactName;
-	
-	/**  */
+
+	@ApiModelProperty(value = "联系人手机",required = false)
 	private String contactPhone;
 	
 	/** 结算类型(按人/按利润比例) */
+	@ApiModelProperty(value = "结算类型(按人/按利润比例)",required = false)
 	private String settlementType;
-	
-	/**  */
+
+	@ApiModelProperty(value = "分润金额",required = false)
 	private java.math.BigDecimal shareProfitAmount;
 	
 	/**  */
@@ -30,7 +32,18 @@ public class Agency {
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	@ApiModelProperty(value = "是否删除",required = false)
+	private Integer delFlag;
+
+	public Integer getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(Integer delFlag) {
+		this.delFlag = delFlag;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

+ 21 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/AgencyQueryInfo.java

@@ -0,0 +1,21 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/17
+ */
+public class AgencyQueryInfo extends QueryInfo {
+
+    private String settlementType;
+
+    public String getSettlementType() {
+        return settlementType;
+    }
+
+    public void setSettlementType(String settlementType) {
+        this.settlementType = settlementType;
+    }
+}

+ 2 - 1
edu-common/src/main/java/com/keao/edu/common/service/SysConfigService.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/SysConfigService.java

@@ -1,7 +1,8 @@
-package com.keao.edu.common.service;
+package com.keao.edu.user.service;
 
 
 import com.keao.edu.common.entity.SysConfig;
+import com.keao.edu.common.service.BaseService;
 
 public interface SysConfigService extends BaseService<Long, SysConfig> {
 

+ 5 - 4
edu-common/src/main/java/com/keao/edu/common/service/impl/SysConfigServiceImpl.java → edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/SysConfigServiceImpl.java

@@ -1,15 +1,16 @@
-package com.keao.edu.common.service.impl;
+package com.keao.edu.user.service.impl;
 
 
 import com.keao.edu.common.dal.BaseDAO;
-import com.keao.edu.common.dal.dao.SysConfigDao;
 import com.keao.edu.common.entity.SysConfig;
-import com.keao.edu.common.service.SysConfigService;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.SysConfigDao;
+import com.keao.edu.user.service.SysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
-public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig>  implements SysConfigService {
+public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig> implements SysConfigService {
 	
 	@Autowired
 	private SysConfigDao sysConfigDao;

+ 47 - 34
edu-user/edu-user-server/src/main/resources/config.mybatis/AgencyMapper.xml

@@ -28,57 +28,70 @@
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.keao.edu.datasource.dal.entity.Agency" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO agency (id_,name_,contact_name_,contact_phone_,settlement_type_,share_profit_amount,create_time_,update_time_) VALUES(#{id},#{name},#{contactName},#{contactPhone},#{settlementType},#{shareProfitAmount},#{createTime},#{updateTime})
+	<insert id="insert" parameterType="com.keao.edu.user.entity.Agency" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO agency (id_,name_,contact_name_,contact_phone_,settlement_type_,share_profit_amount,create_time_,update_time_)
+		VALUES(#{id},#{name},#{contactName},#{contactPhone},#{settlementType},#{shareProfitAmount},#{createTime},#{updateTime})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.keao.edu.datasource.dal.entity.Agency">
+	<update id="update" parameterType="com.keao.edu.user.entity.Agency">
 		UPDATE agency <set>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="contactPhone != null">
-contact_phone_ = #{contactPhone},
-</if>
-<if test="settlementType != null">
-settlement_type_ = #{settlementType},
-</if>
-<if test="contactName != null">
-contact_name_ = #{contactName},
-</if>
-<if test="shareProfitAmount != null">
-share_profit_amount = #{shareProfitAmount},
-</if>
-<if test="name != null">
-name_ = #{name},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-</set> WHERE id_ = #{id} 
+		<if test="id != null">
+		id_ = #{id},
+		</if>
+		<if test="updateTime != null">
+		update_time_ = #{updateTime},
+		</if>
+		<if test="contactPhone != null">
+		contact_phone_ = #{contactPhone},
+		</if>
+		<if test="settlementType != null">
+		settlement_type_ = #{settlementType},
+		</if>
+		<if test="contactName != null">
+		contact_name_ = #{contactName},
+		</if>
+		<if test="shareProfitAmount != null">
+		share_profit_amount = #{shareProfitAmount},
+		</if>
+		<if test="name != null">
+		name_ = #{name},
+		</if>
+		<if test="createTime != null">
+		create_time_ = #{createTime},
+		</if>
+		</set> WHERE id_ = #{id}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM agency WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="agencyQueryPage">
+		<where>
+			del_flag_ = 0
+			<if test="settlementType">
+				AND settlement_type_ = #{settlementType}
+			</if>
+			<if test="search">
+				AND (id_ = #{search} OR name_ LIKE CONCAT('%',#{search},'%')
+				OR contact_name_ LIKE CONCAT('%',#{search},'%')
+				OR contact_phone_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="Agency" parameterType="map">
-		SELECT * FROM agency ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM agency
+		<include refid="agencyQueryPage"/>
+		ORDER BY update_time_ DESC <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM agency
+		<include refid="agencyQueryPage"/>
 	</select>
 </mapper>