ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjMemoController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-hosp/src/main/java/com/ltkj/mall/domain/StjMemo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-hosp/src/main/java/com/ltkj/mall/mapper/StjMemoMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-hosp/src/main/java/com/ltkj/mall/service/IStjMemoService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-hosp/src/main/java/com/ltkj/mall/service/impl/StjMemoServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-hosp/src/main/resources/mapper/mall/StjMemoMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjMemoController.java
New file @@ -0,0 +1,98 @@ package com.ltkj.web.controller.system; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.enums.BusinessType; import com.ltkj.mall.domain.StjMemo; import com.ltkj.mall.service.IStjMemoService; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; /** * 备忘录Controller * * @author ltkj_赵佳豪&李格 * @date 2023-11-15 */ @RestController @RequestMapping("/mall/memo") public class StjMemoController extends BaseController { @Autowired private IStjMemoService stjMemoService; /** * 查询备忘录列表 */ // @PreAuthorize("@ss.hasPermi('mall:memo:list')") @GetMapping("/list") public TableDataInfo list(StjMemo stjMemo) { startPage(); List<StjMemo> list = stjMemoService.selectStjMemoList(stjMemo); return getDataTable(list); } /** * 导出备忘录列表 */ // @PreAuthorize("@ss.hasPermi('mall:memo:export')") @Log(title = "备忘录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, StjMemo stjMemo) { List<StjMemo> list = stjMemoService.selectStjMemoList(stjMemo); ExcelUtil<StjMemo> util = new ExcelUtil<StjMemo>(StjMemo.class); util.exportExcel(response, list, "备忘录数据"); } /** * 获取备忘录详细信息 */ // @PreAuthorize("@ss.hasPermi('mall:memo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(stjMemoService.selectStjMemoById(id)); } /** * 新增备忘录 */ // @PreAuthorize("@ss.hasPermi('mall:memo:add')") @Log(title = "备忘录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody StjMemo stjMemo) { return toAjax(stjMemoService.insertStjMemo(stjMemo)); } /** * 修改备忘录 */ // @PreAuthorize("@ss.hasPermi('mall:memo:edit')") @Log(title = "备忘录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody StjMemo stjMemo) { return toAjax(stjMemoService.updateStjMemo(stjMemo)); } /** * 删除备忘录 */ // @PreAuthorize("@ss.hasPermi('mall:memo:remove')") @Log(title = "备忘录", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(stjMemoService.deleteStjMemoByIds(ids)); } } ltkj-hosp/src/main/java/com/ltkj/mall/domain/StjMemo.java
New file @@ -0,0 +1,129 @@ package com.ltkj.mall.domain; import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.ltkj.common.annotation.Excel; import com.ltkj.common.core.domain.BaseEntity; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 备忘录对象 stj_memo * * @author ltkj_赵佳豪&李格 * @date 2023-11-15 */ @Data public class StjMemo extends BaseEntity { private static final long serialVersionUID = 1L; /** * id */ @TableId(type = IdType.AUTO) @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * 用户id */ @Excel(name = "用户id") private Long userId; /** * 用户名 */ @Excel(name = "用户名") private String userName; /** * 备忘日期 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "备忘日期", width = 30, dateFormat = "yyyy-MM-dd") private Date mDate; /** * 日期类型(0全天/1指定时间) */ @Excel(name = "日期类型(0全天/1指定时间)") private String dateType; /** * 时间点 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "时间点", width = 30, dateFormat = "yyyy-MM-dd") private Date mTime; /** * 备忘状态(0未完成/1已完成) */ @Excel(name = "备忘状态(0未完成/1已完成)") private String mFlag; /** * 是否重复提醒(Y/N) */ @Excel(name = "是否重复提醒(Y/N)") private String isRepeat; /** * 提醒间隔(15/20/30/60m) */ @Excel(name = "提醒间隔(15/20/30/60m)") private Long repeatTime; /** * 标题 */ @Excel(name = "标题") private String title; /** * 事件 */ @Excel(name = "事件") private String event; /** * 紧急状态(0低/1中/2高) */ @Excel(name = "紧急状态(0低/1中/2高)") private String stateLevel; @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("userId", getUserId()) .append("userName", getUserName()) .append("mDate", getMDate()) .append("dateType", getDateType()) .append("mTime", getMTime()) .append("mFlag", getMFlag()) .append("isRepeat", getIsRepeat()) .append("repeatTime", getRepeatTime()) .append("title", getTitle()) .append("event", getEvent()) .append("stateLevel", getStateLevel()) .append("remark", getRemark()) .append("createTime", getCreateTime()) .append("createBy", getCreateBy()) .append("updateTime", getUpdateTime()) .append("updateBy", getUpdateBy()) .append("deleted", getDeleted()) .append("createId", getCreateId()) .append("updateId", getUpdateId()) .toString(); } } ltkj-hosp/src/main/java/com/ltkj/mall/mapper/StjMemoMapper.java
New file @@ -0,0 +1,65 @@ package com.ltkj.mall.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.mall.domain.MallAftersale; import com.ltkj.mall.domain.StjMemo; import org.apache.ibatis.annotations.Mapper; /** * 备忘录Mapper接口 * * @author ltkj_赵佳豪&李格 * @date 2023-11-15 */ @Mapper public interface StjMemoMapper extends BaseMapper<StjMemo> { /** * 查询备忘录 * * @param id 备忘录主键 * @return 备忘录 */ public StjMemo selectStjMemoById(Long id); /** * 查询备忘录列表 * * @param stjMemo 备忘录 * @return 备忘录集合 */ public List<StjMemo> selectStjMemoList(StjMemo stjMemo); /** * 新增备忘录 * * @param stjMemo 备忘录 * @return 结果 */ public int insertStjMemo(StjMemo stjMemo); /** * 修改备忘录 * * @param stjMemo 备忘录 * @return 结果 */ public int updateStjMemo(StjMemo stjMemo); /** * 删除备忘录 * * @param id 备忘录主键 * @return 结果 */ public int deleteStjMemoById(Long id); /** * 批量删除备忘录 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteStjMemoByIds(Long[] ids); } ltkj-hosp/src/main/java/com/ltkj/mall/service/IStjMemoService.java
New file @@ -0,0 +1,63 @@ package com.ltkj.mall.service; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ltkj.mall.domain.MallTimeConfig; import com.ltkj.mall.domain.StjMemo; /** * 备忘录Service接口 * * @author ltkj_赵佳豪&李格 * @date 2023-11-15 */ public interface IStjMemoService extends IService<StjMemo> { /** * 查询备忘录 * * @param id 备忘录主键 * @return 备忘录 */ public StjMemo selectStjMemoById(Long id); /** * 查询备忘录列表 * * @param stjMemo 备忘录 * @return 备忘录集合 */ public List<StjMemo> selectStjMemoList(StjMemo stjMemo); /** * 新增备忘录 * * @param stjMemo 备忘录 * @return 结果 */ public int insertStjMemo(StjMemo stjMemo); /** * 修改备忘录 * * @param stjMemo 备忘录 * @return 结果 */ public int updateStjMemo(StjMemo stjMemo); /** * 批量删除备忘录 * * @param ids 需要删除的备忘录主键集合 * @return 结果 */ public int deleteStjMemoByIds(Long[] ids); /** * 删除备忘录信息 * * @param id 备忘录主键 * @return 结果 */ public int deleteStjMemoById(Long id); } ltkj-hosp/src/main/java/com/ltkj/mall/service/impl/StjMemoServiceImpl.java
New file @@ -0,0 +1,93 @@ package com.ltkj.mall.service.impl; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ltkj.common.utils.DateUtils; import com.ltkj.mall.domain.MallTimeConfig; import com.ltkj.mall.mapper.MallTimeConfigMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ltkj.mall.mapper.StjMemoMapper; import com.ltkj.mall.domain.StjMemo; import com.ltkj.mall.service.IStjMemoService; /** * 备忘录Service业务层处理 * * @author ltkj_赵佳豪&李格 * @date 2023-11-15 */ @Service public class StjMemoServiceImpl extends ServiceImpl<StjMemoMapper, StjMemo> implements IStjMemoService { @Autowired private StjMemoMapper stjMemoMapper; /** * 查询备忘录 * * @param id 备忘录主键 * @return 备忘录 */ @Override public StjMemo selectStjMemoById(Long id) { return stjMemoMapper.selectStjMemoById(id); } /** * 查询备忘录列表 * * @param stjMemo 备忘录 * @return 备忘录 */ @Override public List<StjMemo> selectStjMemoList(StjMemo stjMemo) { return stjMemoMapper.selectStjMemoList(stjMemo); } /** * 新增备忘录 * * @param stjMemo 备忘录 * @return 结果 */ @Override public int insertStjMemo(StjMemo stjMemo) { stjMemo.setCreateTime(DateUtils.getNowDate()); return stjMemoMapper.insertStjMemo(stjMemo); } /** * 修改备忘录 * * @param stjMemo 备忘录 * @return 结果 */ @Override public int updateStjMemo(StjMemo stjMemo) { stjMemo.setUpdateTime(DateUtils.getNowDate()); return stjMemoMapper.updateStjMemo(stjMemo); } /** * 批量删除备忘录 * * @param ids 需要删除的备忘录主键 * @return 结果 */ @Override public int deleteStjMemoByIds(Long[] ids) { return stjMemoMapper.deleteStjMemoByIds(ids); } /** * 删除备忘录信息 * * @param id 备忘录主键 * @return 结果 */ @Override public int deleteStjMemoById(Long id) { return stjMemoMapper.deleteStjMemoById(id); } } ltkj-hosp/src/main/resources/mapper/mall/StjMemoMapper.xml
New file @@ -0,0 +1,249 @@ <?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.ltkj.mall.mapper.StjMemoMapper"> <resultMap type="StjMemo" id="StjMemoResult"> <result property="id" column="id"/> <result property="userId" column="user_id"/> <result property="userName" column="user_name"/> <result property="mDate" column="m_date"/> <result property="dateType" column="date_type"/> <result property="mTime" column="m_time"/> <result property="mFlag" column="m_flag"/> <result property="isRepeat" column="is_repeat"/> <result property="repeatTime" column="repeat_time"/> <result property="title" column="title"/> <result property="event" column="event"/> <result property="stateLevel" column="state_level"/> <result property="remark" column="remark"/> <result property="createTime" column="create_time"/> <result property="createBy" column="create_by"/> <result property="updateTime" column="update_time"/> <result property="updateBy" column="update_by"/> <result property="deleted" column="deleted"/> <result property="createId" column="create_id"/> <result property="updateId" column="update_id"/> </resultMap> <sql id="selectStjMemoVo"> select id, user_id, user_name, m_date, date_type, m_time, m_flag, is_repeat, repeat_time, title, event, state_level, remark, create_time, create_by, update_time, update_by, deleted, create_id, update_id from stj_memo </sql> <select id="selectStjMemoList" parameterType="StjMemo" resultMap="StjMemoResult"> <include refid="selectStjMemoVo"/> <where> <if test="userId != null "> and user_id = #{userId} </if> <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%') </if> <if test="mDate != null "> and m_date = #{mDate} </if> <if test="dateType != null and dateType != ''"> and date_type = #{dateType} </if> <if test="mTime != null "> and m_time = #{mTime} </if> <if test="mFlag != null and mFlag != ''"> and m_flag = #{mFlag} </if> <if test="isRepeat != null and isRepeat != ''"> and is_repeat = #{isRepeat} </if> <if test="repeatTime != null "> and repeat_time = #{repeatTime} </if> <if test="title != null and title != ''"> and title = #{title} </if> <if test="event != null and event != ''"> and event = #{event} </if> <if test="stateLevel != null and stateLevel != ''"> and state_level = #{stateLevel} </if> <if test="deleted != null "> and deleted = #{deleted} </if> <if test="createId != null and createId != ''"> and create_id = #{createId} </if> <if test="updateId != null and updateId != ''"> and update_id = #{updateId} </if> </where> </select> <select id="selectStjMemoById" parameterType="Long" resultMap="StjMemoResult"> <include refid="selectStjMemoVo"/> where id = #{id} </select> <insert id="insertStjMemo" parameterType="StjMemo" useGeneratedKeys="true" keyProperty="id"> insert into stj_memo <trim prefix="(" suffix=")" suffixOverrides=","> <if test="userId != null">user_id, </if> <if test="userName != null">user_name, </if> <if test="mDate != null">m_date, </if> <if test="dateType != null">date_type, </if> <if test="mTime != null">m_time, </if> <if test="mFlag != null">m_flag, </if> <if test="isRepeat != null">is_repeat, </if> <if test="repeatTime != null">repeat_time, </if> <if test="title != null">title, </if> <if test="event != null">event, </if> <if test="stateLevel != null">state_level, </if> <if test="remark != null">remark, </if> <if test="createTime != null">create_time, </if> <if test="createBy != null">create_by, </if> <if test="updateTime != null">update_time, </if> <if test="updateBy != null">update_by, </if> <if test="deleted != null">deleted, </if> <if test="createId != null">create_id, </if> <if test="updateId != null">update_id, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="userId != null">#{userId}, </if> <if test="userName != null">#{userName}, </if> <if test="mDate != null">#{mDate}, </if> <if test="dateType != null">#{dateType}, </if> <if test="mTime != null">#{mTime}, </if> <if test="mFlag != null">#{mFlag}, </if> <if test="isRepeat != null">#{isRepeat}, </if> <if test="repeatTime != null">#{repeatTime}, </if> <if test="title != null">#{title}, </if> <if test="event != null">#{event}, </if> <if test="stateLevel != null">#{stateLevel}, </if> <if test="remark != null">#{remark}, </if> <if test="createTime != null">#{createTime}, </if> <if test="createBy != null">#{createBy}, </if> <if test="updateTime != null">#{updateTime}, </if> <if test="updateBy != null">#{updateBy}, </if> <if test="deleted != null">#{deleted}, </if> <if test="createId != null">#{createId}, </if> <if test="updateId != null">#{updateId}, </if> </trim> </insert> <update id="updateStjMemo" parameterType="StjMemo"> update stj_memo <trim prefix="SET" suffixOverrides=","> <if test="userId != null">user_id = #{userId}, </if> <if test="userName != null">user_name = #{userName}, </if> <if test="mDate != null">m_date = #{mDate}, </if> <if test="dateType != null">date_type = #{dateType}, </if> <if test="mTime != null">m_time = #{mTime}, </if> <if test="mFlag != null">m_flag = #{mFlag}, </if> <if test="isRepeat != null">is_repeat = #{isRepeat}, </if> <if test="repeatTime != null">repeat_time = #{repeatTime}, </if> <if test="title != null">title = #{title}, </if> <if test="event != null">event = #{event}, </if> <if test="stateLevel != null">state_level = #{stateLevel}, </if> <if test="remark != null">remark = #{remark}, </if> <if test="createTime != null">create_time = #{createTime}, </if> <if test="createBy != null">create_by = #{createBy}, </if> <if test="updateTime != null">update_time = #{updateTime}, </if> <if test="updateBy != null">update_by = #{updateBy}, </if> <if test="deleted != null">deleted = #{deleted}, </if> <if test="createId != null">create_id = #{createId}, </if> <if test="updateId != null">update_id = #{updateId}, </if> </trim> where id = #{id} </update> <delete id="deleteStjMemoById" parameterType="Long"> delete from stj_memo where id = #{id} </delete> <delete id="deleteStjMemoByIds" parameterType="String"> delete from stj_memo where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>