代码备份
							parent
							
								
									9272eaf564
								
							
						
					
					
						commit
						49d109d559
					
				| @ -0,0 +1,83 @@ | ||||
| package com.glxp.api.admin.controller.auth; | ||||
| 
 | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.admin.annotation.AuthRuleAnnotation; | ||||
| import com.glxp.api.admin.entity.auth.DeptEntity; | ||||
| import com.glxp.api.admin.req.auth.FilterDeptRequest; | ||||
| import com.glxp.api.admin.req.inout.DeleteRequest; | ||||
| import com.glxp.api.admin.res.PageSimpleResponse; | ||||
| import com.glxp.api.admin.service.auth.DeptService; | ||||
| import com.glxp.api.admin.util.GennerOrderUtils; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| public class DeptController { | ||||
| 
 | ||||
| 
 | ||||
|     @Resource | ||||
|     private DeptService deptService; | ||||
|     @Resource | ||||
|     private GennerOrderUtils gennerOrderUtils; | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("udi/auth/dept/filter") | ||||
|     public BaseResponse filterList(FilterDeptRequest filterDeptRequest) { | ||||
|         List<DeptEntity> deptEntityList = deptService.filterDepts(filterDeptRequest); | ||||
|         PageInfo<DeptEntity> pageInfo = new PageInfo<>(deptEntityList); | ||||
|         PageSimpleResponse<DeptEntity> deptEntityPageSimpleResponse = new PageSimpleResponse<>(); | ||||
|         deptEntityPageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         deptEntityPageSimpleResponse.setList(deptEntityList); | ||||
|         return ResultVOUtils.success(deptEntityPageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("udi/auth/dept/add") | ||||
|     public BaseResponse addDept(@RequestBody DeptEntity deptEntity) { | ||||
|         deptEntity.setCode(gennerOrderUtils.getDeptCode()); | ||||
|         deptEntity.setUpdateTime(new Date()); | ||||
|         boolean b = deptService.insertDept(deptEntity); | ||||
|         if (b) | ||||
|             return ResultVOUtils.success("添加成功"); | ||||
|         else { | ||||
|             return ResultVOUtils.error(500, "添加失败"); | ||||
|         } | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("udi/auth/dept/update") | ||||
|     public BaseResponse updateDept(@RequestBody DeptEntity deptEntity) { | ||||
|         deptEntity.setUpdateTime(new Date()); | ||||
|         boolean b = deptService.updateDept(deptEntity); | ||||
| 
 | ||||
|         if (b) | ||||
|             return ResultVOUtils.success("更新成功!"); | ||||
|         else { | ||||
|             return ResultVOUtils.error(500, "更新成功!"); | ||||
|         } | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("udi/auth/dept/delete") | ||||
|     public BaseResponse deleteDept(@RequestBody DeleteRequest deleteRequest) { | ||||
|         boolean b = deptService.deleteById(Integer.parseInt(deleteRequest.getId())); | ||||
|         if (b) | ||||
|             return ResultVOUtils.success("删除成功"); | ||||
|         else { | ||||
|             return ResultVOUtils.error(500, "删除失败"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,132 @@ | ||||
| package com.glxp.api.admin.controller.inventory; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import com.glxp.api.admin.annotation.AuthRuleAnnotation; | ||||
| import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; | ||||
| import com.glxp.api.admin.entity.inventory.InvBusUserEntity; | ||||
| import com.glxp.api.admin.req.inout.DeleteRequest; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest; | ||||
| import com.glxp.api.admin.req.inventory.UpdateRelBusRequset; | ||||
| import com.glxp.api.admin.service.inout.WarehouseBussinessTypeService; | ||||
| import com.glxp.api.admin.service.inventory.InvBusUserService; | ||||
| import com.glxp.api.common.enums.ResultEnum; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.springframework.validation.BindingResult; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import javax.validation.Valid; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| public class InvBusUserController { | ||||
| 
 | ||||
| 
 | ||||
|     @Resource | ||||
|     InvBusUserService invBusUserService; | ||||
| 
 | ||||
| 
 | ||||
|     @Resource | ||||
|     WarehouseBussinessTypeService warehouseBussinessTypeService; | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/bus/user/select/filter") | ||||
|     public BaseResponse filterSelectInvUser(FilterInvBusUserRequest filterInvBusUserRequest) { | ||||
|         List<InvBusUserEntity> responses = invBusUserService.filterInvBusUser(filterInvBusUserRequest); | ||||
|         List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = | ||||
|                 warehouseBussinessTypeService.getListByCode(filterInvBusUserRequest.getSubInvCode()); | ||||
| 
 | ||||
|         warehouseBussinessTypeEntities.forEach(warehouseBussinessTypeEntity -> | ||||
|         { | ||||
|             for (InvBusUserEntity invBusUserEntity : responses) { | ||||
|                 if (invBusUserEntity.getScAction().equals(warehouseBussinessTypeEntity.getAction())) { | ||||
|                     warehouseBussinessTypeEntity.setSelect(true); | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|         return ResultVOUtils.success(warehouseBussinessTypeEntities); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("/spms/bus/user/warehouse/update") | ||||
|     public BaseResponse updateRes(@RequestBody UpdateRelBusRequset relBusRequset) { | ||||
|         boolean b = invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode()); | ||||
|         if (CollUtil.isNotEmpty(relBusRequset.getInvBusUserEntities())) { | ||||
|             relBusRequset.getInvBusUserEntities().forEach(warehouseBussinessTypeEntity -> | ||||
|             { | ||||
|                 InvBusUserEntity invBusUserEntity = new InvBusUserEntity(); | ||||
|                 invBusUserEntity.setUserId(relBusRequset.getUserId()); | ||||
|                 invBusUserEntity.setSubInvCode(relBusRequset.getSubInvCode()); | ||||
|                 invBusUserEntity.setScAction(warehouseBussinessTypeEntity.getAction()); | ||||
|                 invBusUserService.insertInvBusUser(invBusUserEntity); | ||||
|             }); | ||||
| 
 | ||||
|         } | ||||
|         return ResultVOUtils.success("修改成功!"); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/bus/user/warehouse/filter") | ||||
|     public BaseResponse filterInvWarehouse(FilterInvBusUserRequest filterInvBusUserRequest) { | ||||
|         List<InvBusUserEntity> responses = invBusUserService.filterInvBusUser(filterInvBusUserRequest); | ||||
|         return ResultVOUtils.success(responses); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("/spms/bus/user/warehouse/save") | ||||
|     public BaseResponse save(@RequestBody @Valid InvBusUserEntity invBusUserEntity, | ||||
|                              BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
| 
 | ||||
|         boolean b = invBusUserService.insertInvBusUser(invBusUserEntity); | ||||
| 
 | ||||
|         if (!b) { | ||||
|             return ResultVOUtils.error(ResultEnum.NOT_NETWORK); | ||||
|         } | ||||
|         return ResultVOUtils.success("添加成功!"); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("/spms/bus/user/warehouse/edit") | ||||
|     public BaseResponse edit(@RequestBody @Valid InvBusUserEntity invBusUserEntity, | ||||
|                              BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         if (invBusUserEntity.getId() == null) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | ||||
|         } | ||||
|         boolean b = invBusUserService.updateInvBusUser(invBusUserEntity); | ||||
|         if (!b) { | ||||
|             return ResultVOUtils.error(ResultEnum.NOT_NETWORK); | ||||
|         } | ||||
|         return ResultVOUtils.success("修改成功!"); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("/spms/bus/user/warehouse/delete") | ||||
|     public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) { | ||||
| 
 | ||||
|         if (deleteRequest.getId() == null) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | ||||
|         } | ||||
|         boolean b = invBusUserService.deleteById(deleteRequest.getId()); | ||||
|         if (!b) { | ||||
|             return ResultVOUtils.error(ResultEnum.NOT_NETWORK); | ||||
|         } | ||||
|         return ResultVOUtils.success(); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| package com.glxp.api.admin.dao.auth; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.auth.DeptEntity; | ||||
| import com.glxp.api.admin.req.auth.FilterDeptRequest; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface DeptDao { | ||||
| 
 | ||||
| 
 | ||||
|     List<DeptEntity> filterDepts(FilterDeptRequest filterDeptRequest); | ||||
| 
 | ||||
|     boolean insertDept(DeptEntity deptEntity); | ||||
| 
 | ||||
|     boolean updateDept(DeptEntity deptEntity); | ||||
| 
 | ||||
| 
 | ||||
|     boolean deleteById(Integer id); | ||||
| 
 | ||||
|     boolean deleteAll(); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| package com.glxp.api.admin.dao.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvBusUserEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface InvBusUserDao { | ||||
| 
 | ||||
| 
 | ||||
|     List<InvBusUserEntity> filterInvBusUser(FilterInvBusUserRequest filterInvBusUserRequest); | ||||
| 
 | ||||
|     boolean insertInvBusUser(InvBusUserEntity InvBusUserEntity); | ||||
| 
 | ||||
|     boolean updateInvBusUser(InvBusUserEntity InvBusUserEntity); | ||||
| 
 | ||||
|     boolean deleteById(@Param("id") String id); | ||||
| 
 | ||||
| 
 | ||||
|     boolean deleteByUnion(@Param("userId") String userId, @Param("subInvCode") String subInvCode); | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package com.glxp.api.admin.entity.auth; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| public class DeptEntity { | ||||
|     private String code; | ||||
|     private Integer id; | ||||
|     private String name; | ||||
|     private String remark; | ||||
|     private Integer flag; | ||||
|     private Date updateTime; | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| package com.glxp.api.admin.entity.inventory; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class InvBusUserEntity { | ||||
|     private Integer id; | ||||
|     private String userId; | ||||
|     private String subInvCode; | ||||
|     private String scAction; | ||||
|     private String remark; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| package com.glxp.api.admin.req.auth; | ||||
| 
 | ||||
| import com.glxp.api.admin.req.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class FilterDeptRequest extends ListPageRequest { | ||||
|     private String code; | ||||
|     private String name; | ||||
|     private Integer flag; | ||||
|     private String lastUpdateTime; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| package com.glxp.api.admin.req.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.req.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class FilterInvBusUserRequest extends ListPageRequest { | ||||
| 
 | ||||
| 
 | ||||
|     private String userId; | ||||
|     private String subInvCode; | ||||
|     private String scAction; | ||||
| } | ||||
| @ -0,0 +1,17 @@ | ||||
| package com.glxp.api.admin.req.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Data | ||||
| public class UpdateRelBusRequset { | ||||
|     private String userId; | ||||
|     private String subInvCode; | ||||
| 
 | ||||
|     private List<WarehouseBussinessTypeEntity> invBusUserEntities; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,23 @@ | ||||
| package com.glxp.api.admin.service.auth; | ||||
| 
 | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.auth.DeptEntity; | ||||
| import com.glxp.api.admin.req.auth.FilterDeptRequest; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface DeptService { | ||||
| 
 | ||||
| 
 | ||||
|     List<DeptEntity> filterDepts(FilterDeptRequest filterDeptRequest); | ||||
| 
 | ||||
|     boolean insertDept(DeptEntity deptEntity); | ||||
| 
 | ||||
|     boolean updateDept(DeptEntity deptEntity); | ||||
| 
 | ||||
|     boolean deleteById(Integer id); | ||||
| 
 | ||||
| 
 | ||||
|     boolean deleteAll(); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,46 @@ | ||||
| package com.glxp.api.admin.service.auth.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.admin.dao.auth.DeptDao; | ||||
| import com.glxp.api.admin.entity.auth.DeptEntity; | ||||
| import com.glxp.api.admin.req.auth.FilterDeptRequest; | ||||
| import com.glxp.api.admin.service.auth.DeptService; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class DeptServiceImpl implements DeptService { | ||||
|     @Resource | ||||
|     DeptDao deptDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<DeptEntity> filterDepts(FilterDeptRequest filterDeptRequest) { | ||||
|         if (filterDeptRequest.getPage() != null) { | ||||
|             int offset = (filterDeptRequest.getPage() - 1) * filterDeptRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterDeptRequest.getLimit()); | ||||
|         } | ||||
|         return deptDao.filterDepts(filterDeptRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertDept(DeptEntity deptEntity) { | ||||
|         return deptDao.insertDept(deptEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateDept(DeptEntity deptEntity) { | ||||
|         return deptDao.updateDept(deptEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(Integer id) { | ||||
|         return deptDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteAll() { | ||||
|         return deptDao.deleteAll(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package com.glxp.api.admin.service.inventory; | ||||
| 
 | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvBusUserEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface InvBusUserService { | ||||
| 
 | ||||
|     List<InvBusUserEntity> filterInvBusUser(FilterInvBusUserRequest filterInvBusUserRequest); | ||||
| 
 | ||||
|     boolean insertInvBusUser(InvBusUserEntity InvBusUserEntity); | ||||
| 
 | ||||
|     boolean updateInvBusUser(InvBusUserEntity InvBusUserEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByUnion(String userId, String subInvCode); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,47 @@ | ||||
| package com.glxp.api.admin.service.inventory.impl; | ||||
| 
 | ||||
| import com.glxp.api.admin.dao.inventory.InvBusUserDao; | ||||
| import com.glxp.api.admin.entity.inventory.InvBusUserEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest; | ||||
| import com.glxp.api.admin.service.inventory.InvBusUserService; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class InvBusUserServiceImpl implements InvBusUserService { | ||||
| 
 | ||||
|     @Resource | ||||
|     InvBusUserDao invBusUserDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<InvBusUserEntity> filterInvBusUser(FilterInvBusUserRequest filterInvBusUserRequest) { | ||||
| 
 | ||||
|         if (filterInvBusUserRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         return invBusUserDao.filterInvBusUser(filterInvBusUserRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertInvBusUser(InvBusUserEntity invBusUserEntity) { | ||||
|         return invBusUserDao.insertInvBusUser(invBusUserEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateInvBusUser(InvBusUserEntity invBusUserEntity) { | ||||
|         return invBusUserDao.updateInvBusUser(invBusUserEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return invBusUserDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByUnion(String userId, String subInvCode) { | ||||
|         return invBusUserDao.deleteByUnion(userId, subInvCode); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,47 @@ | ||||
| <?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.glxp.api.admin.dao.auth.DeptDao"> | ||||
| 
 | ||||
|     <select id="filterDepts" parameterType="com.glxp.api.admin.req.auth.FilterDeptRequest" | ||||
|             resultType="com.glxp.api.admin.entity.auth.DeptEntity"> | ||||
|         SELECT * | ||||
|         FROM auth_dept | ||||
|         <where> | ||||
|             <if test="name != null and '' != name"> | ||||
|                 AND `name` LIKE CONCAT('%',#{name},'%') | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="insertDept" keyProperty="id" parameterType="com.glxp.api.admin.entity.auth.DeptEntity"> | ||||
|         INSERT INTO auth_dept(`name`, `flag`, `remark`, updateTime, code) | ||||
|         values (#{name}, | ||||
|                 #{flag}, | ||||
|                 #{remark}, #{updateTime}, #{code}) | ||||
|     </insert> | ||||
| 
 | ||||
|     <update id="updateDept" parameterType="com.glxp.api.admin.entity.auth.DeptEntity"> | ||||
|         UPDATE auth_dept | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="name != null">`name`=#{name},</if> | ||||
|             <if test="flag != null">`flag`=#{flag},</if> | ||||
|             <if test="remark != null">remark=#{remark},</if> | ||||
|             <if test="code != null">code=#{code},</if> | ||||
|             <if test="updateTime != null">updateTime=#{updateTime},</if> | ||||
|         </trim> | ||||
|         WHERE id=#{id} | ||||
|     </update> | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="java.lang.Integer"> | ||||
|         delete | ||||
|         from auth_dept | ||||
|         where id = #{id} | ||||
|     </delete> | ||||
|     <delete id="deleteAll"> | ||||
|         delete | ||||
|         from auth_dept | ||||
|     </delete> | ||||
| 
 | ||||
| </mapper> | ||||
| @ -0,0 +1,64 @@ | ||||
| <?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.glxp.api.admin.dao.inventory.InvBusUserDao"> | ||||
| 
 | ||||
|     <select id="filterInvBusUser" parameterType="com.glxp.api.admin.req.inventory.FilterInvBusUserRequest" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvBusUserEntity"> | ||||
|         select * | ||||
|         FROM inv_bustype_user | ||||
|         <where> | ||||
|             <if test="userId != '' and userId != null"> | ||||
|                 AND userId = #{userId} | ||||
|             </if> | ||||
|             <if test="subInvCode != '' and subInvCode != null"> | ||||
|                 AND subInvCode = #{subInvCode} | ||||
|             </if> | ||||
|             <if test="scAction != '' and scAction != null"> | ||||
|                 AND scAction = #{scAction} | ||||
|             </if> | ||||
| 
 | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="insertInvBusUser" keyProperty="id" | ||||
|             parameterType="com.glxp.api.admin.entity.inventory.InvBusUserEntity"> | ||||
|         replace | ||||
|         INTO  inv_bustype_user | ||||
|         (userId, `subInvCode`, scAction, remark) | ||||
|         values ( | ||||
|         #{userId}, | ||||
|         #{subInvCode}, | ||||
|         #{scAction}, | ||||
|         #{remark} | ||||
|         ) | ||||
|     </insert> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM inv_bustype_user | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <delete id="deleteByUnion" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM inv_bustype_user | ||||
|         WHERE subInvCode = #{subInvCode} | ||||
|           and userId = #{userId} | ||||
|     </delete> | ||||
|     <update id="updateInvBusUser" parameterType="com.glxp.api.admin.entity.inventory.InvBusUserEntity"> | ||||
|         UPDATE inv_bustype_user | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="userId != null">userId=#{userId},</if> | ||||
|             <if test="subInvCode != null">subInvCode=#{subInvCode},</if> | ||||
|             <if test="parentId != null">parentId=#{parentId},</if> | ||||
|             <if test="scAction != null">scAction=#{scAction},</if> | ||||
|             <if test="remark != null">remark=#{remark},</if> | ||||
|         </trim> | ||||
|         WHERE id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue