master
parent
3cd2bd0137
commit
7ed66b4311
|
@ -28,6 +28,16 @@ public class Information {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-d HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-d HH:mm:ss")
|
||||||
private Date informationTime;
|
private Date informationTime;
|
||||||
|
|
||||||
|
|
||||||
|
//修改人
|
||||||
|
private String informationModify;
|
||||||
|
|
||||||
|
|
||||||
|
//修改时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-d HH:mm:ss")
|
||||||
|
private Date informationDate;
|
||||||
|
|
||||||
//发布图片
|
//发布图片
|
||||||
private String informationPicture;
|
private String informationPicture;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.grail.information.controller;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.grail.common.core.domain.R;
|
import com.grail.common.core.domain.R;
|
||||||
import com.grail.common.core.domain.Result;
|
import com.grail.common.core.domain.Result;
|
||||||
|
import com.grail.domain.model.Information;
|
||||||
import com.grail.domain.request.Vo;
|
import com.grail.domain.request.Vo;
|
||||||
import com.grail.information.service.HealthTypeService;
|
import com.grail.information.service.HealthTypeService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
@ -27,12 +28,68 @@ public class HealthTypeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:shixuchao
|
||||||
|
* @Date:
|
||||||
|
* @Description 咨讯列表展示
|
||||||
|
*/
|
||||||
|
//咨讯列表展示
|
||||||
@GetMapping("/healthTypeList")
|
@GetMapping("/healthTypeList")
|
||||||
private R healthTypeList(){
|
private R healthTypeList(){
|
||||||
R result=healthTypeService.healthTypeList();
|
R result=healthTypeService.healthTypeList();
|
||||||
log.info("功能:将康资讯列表展示 URI:{},方法:{},参数:{}",request.getRequestURI(),
|
log.info("功能:咨讯列表展示 URI:{},方法:{},参数:{}",request.getRequestURI(),
|
||||||
request.getMethod(), JSON.toJSONString(result.getData()));
|
request.getMethod(), JSON.toJSONString(result.getData()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @Author:shixuchao
|
||||||
|
* @Date:
|
||||||
|
* @Description 添加咨询信息
|
||||||
|
*/
|
||||||
|
//添加咨询信息
|
||||||
|
@PostMapping("/informationInsert")
|
||||||
|
private R healthTypeInsert(@RequestBody Information information){
|
||||||
|
R r=healthTypeService.informationInsert(information);
|
||||||
|
log.info("功能:添加咨询信息 URI:{} 方法:{} 参数:{}",request.getRequestURI()
|
||||||
|
,request.getMethod(),JSON.toJSONString(r.getData()));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @Author:shixuchao
|
||||||
|
* @Date:
|
||||||
|
* @Description 回显咨询信息
|
||||||
|
*/
|
||||||
|
//回显咨询信息
|
||||||
|
@PostMapping("/informationFind/{informationId}")
|
||||||
|
private R informationFind(@PathVariable Integer informationId){
|
||||||
|
R r=healthTypeService.informationFind(informationId);
|
||||||
|
log.info("功能:回显咨询信息 URI:{} 方法:{} 参数:{}",request.getRequestURI(),
|
||||||
|
request.getMethod(),JSON.toJSONString(r.getData()));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @Author:shixuchao
|
||||||
|
* @Date:
|
||||||
|
* @Description 修改咨讯信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/informationUpdate")
|
||||||
|
private R informationUpdate(@RequestBody Information information){
|
||||||
|
R r=healthTypeService.informationUpdate(information);
|
||||||
|
log.info("功能:修改咨询信息 URI:{} 方法:{} 参数:{}",request.getRequestURI(),
|
||||||
|
request.getMethod(),JSON.toJSONString(r.getData()));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:shixuchao
|
||||||
|
* @Date:
|
||||||
|
* @Description 咨讯列表展示
|
||||||
|
*/
|
||||||
|
@PostMapping("/informationDelete/{informationId}")
|
||||||
|
private R informationDelete(@PathVariable Integer informationId){
|
||||||
|
R r=healthTypeService.informationDelete(informationId);
|
||||||
|
log.info("功能:添加咨询信息URI:{} 方法:{} 参数:{}",request.getRequestURI(),
|
||||||
|
request.getMethod(),JSON.toJSONString(r.getData()));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,12 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface InformationMapper {
|
public interface InformationMapper {
|
||||||
List<Information> informationList(@Param("healthTypeId") Integer healthTypeId);
|
List<Information> informationList(@Param("healthTypeId") Integer healthTypeId);
|
||||||
|
|
||||||
|
Integer informationInsert(Information information);
|
||||||
|
|
||||||
|
Information informationFind(@Param("informationId") Integer informationId);
|
||||||
|
|
||||||
|
Integer informationUpdate(Information information);
|
||||||
|
|
||||||
|
Integer informationDelete(@Param("informationId") Integer informationId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.grail.information.service;
|
package com.grail.information.service;
|
||||||
|
|
||||||
import com.grail.common.core.domain.R;
|
import com.grail.common.core.domain.R;
|
||||||
|
import com.grail.domain.model.Information;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:
|
* @Author:
|
||||||
|
@ -9,4 +10,12 @@ import com.grail.common.core.domain.R;
|
||||||
*/
|
*/
|
||||||
public interface HealthTypeService {
|
public interface HealthTypeService {
|
||||||
R healthTypeList();
|
R healthTypeList();
|
||||||
|
|
||||||
|
R informationInsert(Information information);
|
||||||
|
|
||||||
|
R informationFind(Integer informationId);
|
||||||
|
|
||||||
|
R informationUpdate(Information information);
|
||||||
|
|
||||||
|
R informationDelete(Integer informationId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,4 +53,28 @@ public class HealthTypeServiceImpl implements HealthTypeService {
|
||||||
return R.ok(healthTypeList);
|
return R.ok(healthTypeList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R informationInsert(Information information) {
|
||||||
|
Integer informationInsert=informationMapper.informationInsert(information);
|
||||||
|
return R.ok(informationInsert,informationInsert>0?"添加成功":"添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R informationFind(Integer informationId) {
|
||||||
|
Information information=informationMapper.informationFind(informationId);
|
||||||
|
return R.ok(information);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R informationUpdate(Information information) {
|
||||||
|
Integer informationUpdate=informationMapper.informationUpdate(information);
|
||||||
|
return R.ok(informationUpdate,informationUpdate>0?"修改成功":"修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R informationDelete(Integer informationId) {
|
||||||
|
Integer informationDelete= informationMapper.informationDelete(informationId);
|
||||||
|
return informationDelete>0?R.ok("删除成功"):R.fail("删除失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,60 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?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" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.grail.information.mapper.InformationMapper">
|
<mapper namespace="com.grail.information.mapper.InformationMapper">
|
||||||
|
<resultMap id="InformationInfo" type="com.grail.domain.model.Information">
|
||||||
|
<id column="information_id" property="informationId"></id>
|
||||||
|
<result column="information_title" property="informationTitle"></result>
|
||||||
|
<result column="user_id" property="userId"></result>
|
||||||
|
<result column="information_time" property="informationTime"></result>
|
||||||
|
<result column="information_modify" property="informationModify"></result>
|
||||||
|
<result column="information_date" property="informationDate"></result>
|
||||||
|
<result column="information_picture" property="informationPicture"></result>
|
||||||
|
<result column="information_content" property="informationContent"></result>
|
||||||
|
<result column="health_type_id" property="healthTypeId"></result>
|
||||||
|
</resultMap>
|
||||||
|
<insert id="informationInsert">
|
||||||
|
INSERT INTO `t_information`
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="informationTitle!=null">information_title,</if>
|
||||||
|
<if test="userId!=null">user_id,</if>
|
||||||
|
<if test="informationTime!=null">information_time,</if>
|
||||||
|
<if test="informationModify!=null">information_modify,</if>
|
||||||
|
<if test="informationDate!=null">information_date,</if>
|
||||||
|
<if test="informationPicture!=null">information_picture,</if>
|
||||||
|
<if test="informationContent!=null">information_content,</if>
|
||||||
|
<if test="healthTypeId!=null">health_type_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="informationTitle!=null">#{informationTitle},</if>
|
||||||
|
<if test="userId!=null">#{userId},</if>
|
||||||
|
<if test="informationTime!=null">#{informationTime},</if>
|
||||||
|
<if test="informationModify!=null">#{informationModify},</if>
|
||||||
|
<if test="informationDate!=null">#{informationDate},</if>
|
||||||
|
<if test="informationPicture!=null">#{informationPicture},</if>
|
||||||
|
<if test="informationContent!=null">#{informationContent},</if>
|
||||||
|
<if test="healthTypeId!=null">#{healthTypeId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="informationUpdate">
|
||||||
|
UPDATE `t_information`
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="informationTitle!=null">information_title=#{informationTitle},</if>
|
||||||
|
<if test="userId!=null">user_id=#{userId},</if>
|
||||||
|
<if test="informationTime!=null">information_time=#{informationTime},</if>
|
||||||
|
<if test="informationModify!=null">information_modify=#{informationModify},</if>
|
||||||
|
<if test="informationDate!=null">information_date=#{informationDate},</if>
|
||||||
|
<if test="informationPicture!=null">information_picture=#{informationPicture},</if>
|
||||||
|
<if test="informationContent!=null">information_content=#{informationContent},</if>
|
||||||
|
<if test="healthTypeId!=null">health_type_id=#{healthTypeId},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE `information_id` = #{informationId};
|
||||||
|
|
||||||
<select id="informationList" resultType="com.grail.domain.model.Information">
|
</update>
|
||||||
|
<delete id="informationDelete">
|
||||||
|
delete from t_information where information_id=#{informationId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="informationList" resultMap="InformationInfo">
|
||||||
select information_id,
|
select information_id,
|
||||||
information_title,
|
information_title,
|
||||||
user_id,
|
user_id,
|
||||||
|
@ -15,4 +67,16 @@
|
||||||
from t_information where health_type_id=#{healthTypeId}
|
from t_information where health_type_id=#{healthTypeId}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="informationFind" resultMap="InformationInfo">
|
||||||
|
select information_id,
|
||||||
|
information_title,
|
||||||
|
user_id,
|
||||||
|
information_time,
|
||||||
|
information_modify,
|
||||||
|
information_date,
|
||||||
|
information_picture,
|
||||||
|
information_content,
|
||||||
|
health_type_id
|
||||||
|
from t_information where information_id=#{informationId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue