yujian
2019-03-27 9164a0eeb65eb413657268a7ac9f82dc2944bf38
改造clientParamsDao
2个文件已修改
8个文件已添加
293 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerContentMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerNameMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerContent.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerName.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerContentMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerNameMapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerContentServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerNameServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerContentService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerNameService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerContentMapper.java
New file
@@ -0,0 +1,17 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.CustomerContent;
public interface CustomerContentMapper extends BaseMapper<CustomerContent>{
    List<CustomerContent> listByCnidAndTitle(@Param("start") long start, @Param("count") int count,
            @Param("cnid")Long cnid, @Param("key")String key);
    List<CustomerContent> contactCustomerService(@Param("title")String title);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerNameMapper.java
New file
@@ -0,0 +1,14 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.CustomerName;
public interface CustomerNameMapper extends BaseMapper<CustomerName>{
    List<CustomerName> listByTypeAndName(@Param("start") long start, @Param("count") int count,
            @Param("type")Integer type, @Param("key")String key);
}
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerContent.java
@@ -2,28 +2,21 @@
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@Entity
@Table(name = "yeshi_ec_customer_content")
@Table("yeshi_ec_customer_content")
public class CustomerContent {
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    @Expose
    private long id;
    @Column(name = "id")
    private Long id;
    
    @Expose
    @Column(name = "cn_id")
    private long cnId;
    private Long cnId;
    
    @Expose
    @Column(name = "title")
@@ -37,27 +30,19 @@
    @Column(name="createTime")
    private Date createTime;
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
    public long getCnId() {
    public Long getCnId() {
        return cnId;
    }
    public void setCnId(long cnId) {
    public void setCnId(Long cnId) {
        this.cnId = cnId;
    }
@@ -76,6 +61,13 @@
    public void setContent(String content) {
        this.content = content;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerName.java
@@ -3,25 +3,17 @@
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@Entity
@Table(name = "yeshi_ec_customer_name")
@Table("yeshi_ec_customer_name")
public class CustomerName {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    @Expose
    private long id;
    private Long id;
    @Column(name = "name")
    private String name;
@@ -32,16 +24,16 @@
    @Column(name = "type")
    private Integer type; // 1:帮助中心 2:关于我们 3:返利详情用户协议 4:联系客服
    @Transient
    private List<CustomerContent> customerContentList;//一级标题下面的二级标题内容
    
    
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerContentMapper.xml
New file
@@ -0,0 +1,57 @@
<?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.yeshi.fanli.dao.mybatis.CustomerContentMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.CustomerContent">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="cn_id" property="cnId" jdbcType="BIGINT"/>
    <result column="title" property="title" jdbcType="VARCHAR"/>
    <result column="content" property="content" jdbcType="VARCHAR"/>
    <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">id,cn_id,title,content,createTime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_customer_content where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_customer_content where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.CustomerContent" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_content (id,cn_id,title,content,createTime) values (#{id,jdbcType=BIGINT},#{cnId,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.CustomerContent" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_content
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="cnId != null">cn_id,</if>
      <if test="title != null">title,</if>
      <if test="content != null">content,</if>
      <if test="createTime != null">createTime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="cnId != null">#{cnId,jdbcType=BIGINT},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="content != null">#{content,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.CustomerContent">update yeshi_ec_customer_content set cn_id = #{cnId,jdbcType=BIGINT},title = #{title,jdbcType=VARCHAR},content = #{content,jdbcType=VARCHAR},createTime = #{createTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.CustomerContent">update yeshi_ec_customer_content
    <set>
      <if test="cnId != null">cn_id=#{cnId,jdbcType=BIGINT},</if>
      <if test="title != null">title=#{title,jdbcType=VARCHAR},</if>
      <if test="content != null">content=#{content,jdbcType=VARCHAR},</if>
      <if test="createTime != null">createTime=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listByCnidAndTitle" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_customer_content  t
    WHERE t.`cn_id` = #{cnid} AND t.`title` LIKE '%${key}%'
    ORDER BY t.`createTime` ASC
    LIMIT #{start},#{count}
  </select>
   <select id="contactCustomerService" resultMap="BaseResultMap">
         <!-- 查询联系客服信息 -->
        SELECT yecc.`content` FROM `yeshi_ec_customer_content` yecc
        WHERE yecc.`title` = #{title}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerNameMapper.xml
New file
@@ -0,0 +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.yeshi.fanli.dao.mybatis.CustomerNameMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.CustomerName">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="name" property="name" jdbcType="VARCHAR"/>
    <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="type" property="type" jdbcType="INTEGER"/>
  </resultMap>
  <sql id="Base_Column_List">id,`name`,createTime,`type`</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_customer_name where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_customer_name where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.CustomerName" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_name (id,`name`,createTime,`type`) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.CustomerName" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_name
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="name != null">`name`,</if>
      <if test="createTime != null">createTime,</if>
      <if test="type != null">`type`,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="type != null">#{type,jdbcType=INTEGER},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.CustomerName">update yeshi_ec_customer_name set `name` = #{name,jdbcType=VARCHAR},createTime = #{createTime,jdbcType=TIMESTAMP},`type` = #{type,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.CustomerName">update yeshi_ec_customer_name
    <set>
      <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
      <if test="createTime != null">createTime=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="type != null">`type`=#{type,jdbcType=INTEGER},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listByTypeAndName" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_customer_name cn
    WHERE cn.`type` = #{type} AND cn.`name` LIKE '%${key}%'
    ORDER BY cn.`createtime` ASC
    LIMIT #{start},#{count}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerContentServiceImpl.java
New file
@@ -0,0 +1,37 @@
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.CustomerContentMapper;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.util.Constant;
@Service
public class CustomerContentServiceImpl implements CustomerContentService {
    @Resource
    private CustomerContentMapper customerContentMapper;
    @Override
    public List<CustomerContent> getSecondProblemList(int index, String key, long id) {
        return customerContentMapper.listByCnidAndTitle(index * Constant.PAGE_SIZE, Constant.PAGE_SIZE, id, key);
    }
    @Override
    public CustomerContent getCustomerContent(long id) {
        return customerContentMapper.selectByPrimaryKey(id);
    }
    @Override
    public List<CustomerContent> contactCustomerService(String title) {
        return customerContentMapper.contactCustomerService(title);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerNameServiceImpl.java
New file
@@ -0,0 +1,25 @@
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.CustomerNameMapper;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.service.inter.config.CustomerNameService;
import com.yeshi.fanli.util.Constant;
@Service
public class CustomerNameServiceImpl implements CustomerNameService {
    @Resource
    private CustomerNameMapper customerNameMapper;
    @Override
    public List<CustomerName> customerNameList(int page, String key, int type) {
         return customerNameMapper.listByTypeAndName(page * Constant.PAGE_SIZE, Constant.PAGE_SIZE, type, key);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerContentService.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import com.yeshi.fanli.entity.system.CustomerContent;
public interface CustomerContentService {
    public List<CustomerContent> getSecondProblemList(int index, String key, long id);
    public CustomerContent getCustomerContent(long id);
    public List<CustomerContent> contactCustomerService(String title);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerNameService.java
New file
@@ -0,0 +1,13 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import com.yeshi.fanli.entity.system.CustomerName;
public interface CustomerNameService {
    public List<CustomerName> customerNameList(int page, String key, int type);
}