¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.service.data.DictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09.26 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("/Dict") |
| | | public class DictController { |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @RequestMapping(value = "/insertDict", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertDict(DictEntity dictEntity) { |
| | | |
| | | return dictService.insertDict(dictEntity); |
| | | } |
| | | |
| | | @RequestMapping(value = "/insertDicts", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertDicts(@RequestBody List<DictEntity> dictEntity) { |
| | | |
| | | return dictService.insertDicts(dictEntity); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/deleteDict", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteStyle(int id) { |
| | | return dictService.deleteDict(id); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/deleteDicts", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteDicts(@RequestBody List<Integer> ids) { |
| | | if (!ids.isEmpty()) { |
| | | return dictService.deleteDicts(ids); |
| | | } else { |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateDict", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer updateDict(DictEntity dictEntity) { |
| | | return dictService.updateDict(dictEntity); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectDict") |
| | | public DictEntity selectDict(int id) { |
| | | return dictService.selectDict(id); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectDictAll") |
| | | public List<DictEntity> selectDictAll() { |
| | | return dictService.selectDictAll(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.lf.server.entity.data.StyleEntity; |
| | | import com.lf.server.service.data.StyleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09.26 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("/Style") |
| | | public class StyleController { |
| | | @Autowired |
| | | StyleService styleService; |
| | | |
| | | @RequestMapping(value = "/insertStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertStyle(StyleEntity styleEntity) { |
| | | |
| | | return styleService.insertStyle(styleEntity); |
| | | } |
| | | |
| | | @RequestMapping(value = "/insertStyles", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertStyles(@RequestBody List<StyleEntity> styleEntity) { |
| | | |
| | | return styleService.insertStyles(styleEntity); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/deleteStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteStyle(int id) { |
| | | return styleService.deleteStyle(id); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/deleteStyles", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteStyles(@RequestBody List<Integer> ids) { |
| | | if (!ids.isEmpty()) { |
| | | return styleService.deleteStyles(ids); |
| | | } else { |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateStyle", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer updateStyle(StyleEntity styleEntity) { |
| | | return styleService.updateStyle(styleEntity); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectStyle") |
| | | public StyleEntity selectStyle(int id) { |
| | | return styleService.selectStyle(id); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectStyleAll") |
| | | public List<StyleEntity> selectStyleAll() { |
| | | return styleService.selectStyleAll(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | |
| | | public class DictEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -343890141066128689L; |
| | | |
| | | private int id; |
| | | |
| | | private String ns; |
| | | |
| | | private String tab; |
| | | |
| | | private String tabDesc; |
| | | |
| | | private String field; |
| | | |
| | | private String alias; |
| | | |
| | | private String type; |
| | | |
| | | private int len; |
| | | |
| | | private int precision; |
| | | |
| | | private int orderNum; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getTabDesc() { |
| | | return tabDesc; |
| | | } |
| | | |
| | | public void setTabDesc(String tabDesc) { |
| | | this.tabDesc = tabDesc; |
| | | } |
| | | |
| | | public String getField() { |
| | | return field; |
| | | } |
| | | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | |
| | | public String getAlias() { |
| | | return alias; |
| | | } |
| | | |
| | | public void setAlias(String alias) { |
| | | this.alias = alias; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getLen() { |
| | | return len; |
| | | } |
| | | |
| | | public void setLen(int len) { |
| | | this.len = len; |
| | | } |
| | | |
| | | public int getPrecision() { |
| | | return precision; |
| | | } |
| | | |
| | | public void setPrecision(int precision) { |
| | | this.precision = precision; |
| | | } |
| | | |
| | | public int getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(int orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | |
| | | public class StyleEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2421229801055033955L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private String ver; |
| | | |
| | | private int status; |
| | | |
| | | private String precision; |
| | | |
| | | private String descr; |
| | | |
| | | private String fileGuid; |
| | | |
| | | private String viewGuid; |
| | | |
| | | private String createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public String getVer() { |
| | | return ver; |
| | | } |
| | | |
| | | public void setVer(String ver) { |
| | | this.ver = ver; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getPrecision() { |
| | | return precision; |
| | | } |
| | | |
| | | public void setPrecision(String precision) { |
| | | this.precision = precision; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getFileGuid() { |
| | | return fileGuid; |
| | | } |
| | | |
| | | public void setFileGuid(String fileGuid) { |
| | | this.fileGuid = fileGuid; |
| | | } |
| | | |
| | | public String getViewGuid() { |
| | | return viewGuid; |
| | | } |
| | | |
| | | public void setViewGuid(String viewGuid) { |
| | | this.viewGuid = viewGuid; |
| | | } |
| | | |
| | | public String getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(String createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.data; |
| | | |
| | | |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | public interface DictMapper { |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param dictEntity |
| | | * @return |
| | | */ |
| | | public Integer insertDict(DictEntity dictEntity); |
| | | |
| | | /** |
| | | * æ¹éæ·»å |
| | | * @param dictEntity |
| | | * @return |
| | | */ |
| | | public Integer insertDicts(List<DictEntity> dictEntity); |
| | | /** |
| | | * åªé¤æ°æ® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteDict(int id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deleteDicts(List<Integer> ids); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ°æ® |
| | | * @param dictEntity |
| | | * @return |
| | | */ |
| | | public Integer updateDict(DictEntity dictEntity); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡æ°æ® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public DictEntity selectDict(int id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨æ°æ® |
| | | * @return |
| | | */ |
| | | public List<DictEntity> selectDictAll(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.data; |
| | | |
| | | import com.lf.server.entity.data.StyleEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | @Mapper |
| | | @ResponseBody |
| | | public interface StyleMapper { |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param styleEntity |
| | | * @return |
| | | */ |
| | | public Integer insertStyle(StyleEntity styleEntity); |
| | | |
| | | /** |
| | | * æ¹éæ·»å |
| | | * @param styleEntity |
| | | * @return |
| | | */ |
| | | public Integer insertStyles(List<StyleEntity> styleEntity); |
| | | /** |
| | | * åªé¤æ°æ® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteStyle(int id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deleteStyles(List<Integer> ids); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ°æ® |
| | | * @param styleEntity |
| | | * @return |
| | | */ |
| | | public Integer updateStyle(StyleEntity styleEntity); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡æ°æ® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public StyleEntity selectStyle(int id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨æ°æ® |
| | | * @return |
| | | */ |
| | | public List<StyleEntity> selectStyleAll(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.mapper.data.DictMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | @Service |
| | | public class DictService implements DictMapper { |
| | | |
| | | @Autowired |
| | | DictMapper dictMapper; |
| | | |
| | | @Override |
| | | public Integer insertDict(DictEntity dictEntity) { |
| | | return dictMapper.insertDict(dictEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertDicts(List<DictEntity> dictEntity) { |
| | | return dictMapper.insertDicts(dictEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteDict(int id) { |
| | | return dictMapper.deleteDict(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteDicts(List<Integer> ids) { |
| | | return dictMapper.deleteDicts(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateDict(DictEntity dictEntity) { |
| | | return dictMapper.updateDict(dictEntity); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public DictEntity selectDict(int id) { |
| | | return dictMapper.selectDict(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<DictEntity> selectDictAll() { |
| | | return dictMapper.selectDictAll(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.StyleEntity; |
| | | import com.lf.server.mapper.data.StyleMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | |
| | | @Service |
| | | public class StyleService implements StyleMapper { |
| | | @Autowired |
| | | StyleMapper styleMapper; |
| | | |
| | | @Override |
| | | public Integer insertStyle(StyleEntity styleEntity) { |
| | | return styleMapper.insertStyle(styleEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertStyles(List<StyleEntity> styleEntity) { |
| | | return styleMapper.insertStyles(styleEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteStyle(int id) { |
| | | return styleMapper.deleteStyle(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteStyles(List<Integer> ids) { |
| | | return styleMapper.deleteStyles(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateStyle(StyleEntity styleEntity) { |
| | | return styleMapper.updateStyle(styleEntity); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public StyleEntity selectStyle(int id) { |
| | | return styleMapper.selectStyle(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StyleEntity> selectStyleAll() { |
| | | return styleMapper.selectStyleAll(); |
| | | } |
| | | } |
| | |
| | | username : postgres |
| | | password: postgres |
| | | url : jdbc:postgresql://192.168.20.39:5433/langfang |
| | | #url : jdbc:postgresql://127.0.0.1:5433/postgres |
| | | driver-class-name: org.postgresql.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource # èªå®ä¹æ°æ®æº |
| | | |
| | | #url : jdbc:postgresql://127.0.0.1:5433/postgres |
| | | #Spring Boot é»è®¤æ¯ä¸æ³¨å
¥è¿äºå±æ§å¼çï¼éè¦èªå·±ç»å® |
| | | #druid æ°æ®æºä¸æé
ç½® |
| | | initialSize: 5 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.lf.server.mapper.data.DictMapper"> |
| | | <resultMap id="resultMap" type="com.lf.server.entity.data.DictEntity"> |
| | | <id property="id" column="id"></id> |
| | | <result property="tabDesc" column="tab_desc"></result> |
| | | <result property="orderNum" column="order_num"></result> |
| | | <result property="createUser" column="create_user"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="updateUser" column="update_user"></result> |
| | | <result property="updateTime" column="update_time"></result> |
| | | </resultMap> |
| | | <select id="selectDictAll" resultMap="resultMap" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select * from lf.sys_dict |
| | | </select> |
| | | |
| | | <select id="selectDict" resultMap="resultMap" resultType="com.lf.server.entity.data.DictEntity"> |
| | | select * from lf.sys_dict where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertDict" parameterType="com.lf.server.entity.data.DictEntity"> |
| | | insert into lf.sys_dict |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,bak) |
| | | values |
| | | (#{ns},#{tab},#{tabDesc},#{field},#{alias},#{type},#{len},#{precision},#{orderNum},#{createUser}, |
| | | now(),#{bak}); |
| | | </insert> |
| | | |
| | | <insert id="insertDicts" > |
| | | insert into lf.sys_dict |
| | | (ns,tab,tab_desc,field,alias,type,len,precision,order_num,create_user,create_time,bak) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{item.ns},#{item.tab},#{item.tabDesc},#{item.field},#{item.alias},#{item.type},#{item.len}, |
| | | #{item.precision},#{item.orderNum},#{item.createUser},now(),#{item.bak}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteDict" > |
| | | delete from lf.sys_dict where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteDicts" > |
| | | delete from lf.sys_dict where id in |
| | | <foreach item="ids" collection="list" index="index" open="(" |
| | | separator="," close=")"> |
| | | #{ids} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDict"> |
| | | update lf.sys_dict set ns=#{ns},tab=#{tab},tab_desc=#{tabDesc},field=#{field},alias=#{alias},type=#{type}, |
| | | len=#{len},precision=#{precision}, order_num=#{orderNum},update_user=#{updateUser},update_time=now(),bak=#{bak} where id=#{id} |
| | | </update> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.lf.server.mapper.data.StyleMapper"> |
| | | <resultMap id="resultMap" type="com.lf.server.entity.data.StyleEntity"> |
| | | <id property="id" column="id"></id> |
| | | <result property="fileGuid" column="file_guid"></result> |
| | | <result property="viewGuid" column="view_guid"></result> |
| | | <result property="createUser" column="create_user"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="updateUser" column="update_user"></result> |
| | | <result property="updateTime" column="update_time"></result> |
| | | </resultMap> |
| | | <select id="selectStyleAll" resultMap="resultMap" resultType="com.lf.server.entity.data.StyleEntity"> |
| | | select * from lf.sys_style |
| | | </select> |
| | | |
| | | <select id="selectStyle" resultMap="resultMap" resultType="com.lf.server.entity.data.StyleEntity"> |
| | | select * from lf.sys_style where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertStyle" parameterType="com.lf.server.entity.data.StyleEntity"> |
| | | insert into lf.sys_style |
| | | (name,type,dirid,depid,ver,status,precision,descr,file_guid,view_guid,create_user,create_time,bak) |
| | | values |
| | | (#{name},#{type},#{dirid},#{depid},#{ver},#{status},#{precision},#{descr},#{fileGuid},#{viewGuid},#{createUser}, |
| | | now(),#{bak}); |
| | | </insert> |
| | | |
| | | <insert id="insertStyles" > |
| | | insert into lf.sys_style |
| | | (name,type,dirid,depid,ver,status,precision,descr,file_guid,view_guid,create_user,create_time,bak) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{item.name},#{item.type},#{item.dirid},#{item.depid},#{item.ver},#{item.status},#{item.precision},#{item.descr}, |
| | | #{item.fileGuid},#{item.viewGuid},#{item.createUser},now(),#{item.bak}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteStyle" > |
| | | delete from lf.sys_style where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteStyles" > |
| | | delete from lf.sys_style where id in |
| | | <foreach item="ids" collection="list" index="index" open="(" |
| | | separator="," close=")"> |
| | | #{ids} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateStyle"> |
| | | update lf.sys_style set name=#{name},type=#{type},dirid=#{dirid},depid=#{depid},ver=#{ver},status=#{status},precision=#{precision}, |
| | | descr=#{descr},file_guid=#{fileGuid},view_guid=#{viewGuid},update_user=#{updateUser},update_time=now(),bak=#{bak} where id=#{id} |
| | | </update> |
| | | </mapper> |