Commit 70f0dae4 authored by 季圣华's avatar 季圣华
Browse files

优化表结构

parent 13932441
...@@ -6,91 +6,25 @@ import java.util.List; ...@@ -6,91 +6,25 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
public interface SerialNumberMapper { public interface SerialNumberMapper {
/** long countByExample(SerialNumberExample example);
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int countByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int deleteByExample(SerialNumberExample example); int deleteByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int insert(SerialNumber record); int insert(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int insertSelective(SerialNumber record); int insertSelective(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
List<SerialNumber> selectByExample(SerialNumberExample example); List<SerialNumber> selectByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
SerialNumber selectByPrimaryKey(Long id); SerialNumber selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); int updateByExampleSelective(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByExample(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); int updateByExample(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(SerialNumber record); int updateByPrimaryKeySelective(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByPrimaryKey(SerialNumber record); int updateByPrimaryKey(SerialNumber record);
} }
\ No newline at end of file
...@@ -6,91 +6,25 @@ import java.util.List; ...@@ -6,91 +6,25 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
public interface UserBusinessMapper { public interface UserBusinessMapper {
/** long countByExample(UserBusinessExample example);
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int countByExample(UserBusinessExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int deleteByExample(UserBusinessExample example); int deleteByExample(UserBusinessExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int insert(UserBusiness record); int insert(UserBusiness record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int insertSelective(UserBusiness record); int insertSelective(UserBusiness record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
List<UserBusiness> selectByExample(UserBusinessExample example); List<UserBusiness> selectByExample(UserBusinessExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
UserBusiness selectByPrimaryKey(Long id); UserBusiness selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example); int updateByExampleSelective(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int updateByExample(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example); int updateByExample(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(UserBusiness record); int updateByPrimaryKeySelective(UserBusiness record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_userbusiness
*
* @mbggenerated
*/
int updateByPrimaryKey(UserBusiness record); int updateByPrimaryKey(UserBusiness record);
} }
\ No newline at end of file
...@@ -9,5 +9,7 @@ import java.util.Date; /** ...@@ -9,5 +9,7 @@ import java.util.Date; /**
* @Date: 2019/3/29 15:09 * @Date: 2019/3/29 15:09
*/ */
public interface UserBusinessMapperEx { public interface UserBusinessMapperEx {
int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
} }
...@@ -4,13 +4,13 @@ import com.jsh.erp.datasource.entities.Account; ...@@ -4,13 +4,13 @@ import com.jsh.erp.datasource.entities.Account;
public class AccountVo4List extends Account{ public class AccountVo4List extends Account{
private String thismonthamount; private String thisMonthAmount;
public String getThismonthamount() { public String getThisMonthAmount() {
return thismonthamount; return thisMonthAmount;
} }
public void setThismonthamount(String thismonthamount) { public void setThisMonthAmount(String thisMonthAmount) {
this.thismonthamount = thismonthamount; this.thisMonthAmount = thisMonthAmount;
} }
} }
\ No newline at end of file
...@@ -4,16 +4,16 @@ import com.jsh.erp.datasource.entities.Log; ...@@ -4,16 +4,16 @@ import com.jsh.erp.datasource.entities.Log;
public class LogVo4List extends Log { public class LogVo4List extends Log {
private String username; private String userName;
private String createTimeStr; private String createTimeStr;
public String getUsername() { public String getUserName() {
return username; return userName;
} }
public void setUsername(String username) { public void setUserName(String userName) {
this.username = username; this.userName = userName;
} }
public String getCreateTimeStr() { public String getCreateTimeStr() {
......
...@@ -104,9 +104,9 @@ public class AccountService { ...@@ -104,9 +104,9 @@ public class AccountService {
if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) { if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) {
thisMonthAmountFmt = df.format(thisMonthAmount); thisMonthAmountFmt = df.format(thisMonthAmount);
} }
al.setThismonthamount(thisMonthAmountFmt); //本月发生额 al.setThisMonthAmount(thisMonthAmountFmt); //本月发生额
BigDecimal currentAmount = getAccountSum(al.getId(), "", "month").add(getAccountSumByHead(al.getId(), "", "month")).add(getAccountSumByDetail(al.getId(), "", "month")).add(getManyAccountSum(al.getId(), "", "month")) .add(al.getInitialamount()) ; BigDecimal currentAmount = getAccountSum(al.getId(), "", "month").add(getAccountSumByHead(al.getId(), "", "month")).add(getAccountSumByDetail(al.getId(), "", "month")).add(getManyAccountSum(al.getId(), "", "month")) .add(al.getInitialAmount()) ;
al.setCurrentamount(currentAmount); al.setCurrentAmount(currentAmount);
resList.add(al); resList.add(al);
} }
} }
...@@ -126,10 +126,10 @@ public class AccountService { ...@@ -126,10 +126,10 @@ public class AccountService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertAccount(String beanJson, HttpServletRequest request)throws Exception { public int insertAccount(String beanJson, HttpServletRequest request)throws Exception {
Account account = JSONObject.parseObject(beanJson, Account.class); Account account = JSONObject.parseObject(beanJson, Account.class);
if(account.getInitialamount() == null) { if(account.getInitialAmount() == null) {
account.setInitialamount(BigDecimal.ZERO); account.setInitialAmount(BigDecimal.ZERO);
} }
account.setIsdefault(false); account.setIsDefault(false);
int result=0; int result=0;
try{ try{
result = accountMapper.insertSelective(account); result = accountMapper.insertSelective(account);
...@@ -442,7 +442,7 @@ public class AccountService { ...@@ -442,7 +442,7 @@ public class AccountService {
logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId, logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
Account account = new Account(); Account account = new Account();
account.setIsdefault(isDefault); account.setIsDefault(isDefault);
AccountExample example = new AccountExample(); AccountExample example = new AccountExample();
example.createCriteria().andIdEqualTo(accountId); example.createCriteria().andIdEqualTo(accountId);
int result=0; int result=0;
...@@ -561,7 +561,7 @@ public class AccountService { ...@@ -561,7 +561,7 @@ public class AccountService {
BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month").add(getAccountSumByHead(a.getId(), timeStr, "month")) BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month").add(getAccountSumByHead(a.getId(), timeStr, "month"))
.add(getAccountSumByDetail(a.getId(), timeStr, "month")).add(getManyAccountSum(a.getId(), timeStr, "month")); .add(getAccountSumByDetail(a.getId(), timeStr, "month")).add(getManyAccountSum(a.getId(), timeStr, "month"));
BigDecimal currentAmount = getAccountSum(a.getId(), "", "month").add(getAccountSumByHead(a.getId(), "", "month")) BigDecimal currentAmount = getAccountSum(a.getId(), "", "month").add(getAccountSumByHead(a.getId(), "", "month"))
.add(getAccountSumByDetail(a.getId(), "", "month")).add(getManyAccountSum(a.getId(), "", "month")).add(a.getInitialamount()); .add(getAccountSumByDetail(a.getId(), "", "month")).add(getManyAccountSum(a.getId(), "", "month")).add(a.getInitialAmount());
allMonthAmount = allMonthAmount.add(monthAmount); allMonthAmount = allMonthAmount.add(monthAmount);
allCurrentAmount = allCurrentAmount.add(currentAmount); allCurrentAmount = allCurrentAmount.add(currentAmount);
} }
......
package com.jsh.erp.service.functions; package com.jsh.erp.service.functions;
import com.jsh.erp.service.ICommonQuery; import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.functions.FunctionsService;
import com.jsh.erp.utils.Constants; import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils; import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
...@@ -12,16 +11,16 @@ import javax.servlet.http.HttpServletRequest; ...@@ -12,16 +11,16 @@ import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Service(value = "functions_component") @Service(value = "function_component")
@FunctionsResource @FunctionResource
public class FunctionsComponent implements ICommonQuery { public class FunctionComponent implements ICommonQuery {
@Resource @Resource
private FunctionsService functionsService; private FunctionService functionService;
@Override @Override
public Object selectOne(Long id) throws Exception { public Object selectOne(Long id) throws Exception {
return functionsService.getFunctions(id); return functionService.getFunction(id);
} }
@Override @Override
...@@ -34,7 +33,7 @@ public class FunctionsComponent implements ICommonQuery { ...@@ -34,7 +33,7 @@ public class FunctionsComponent implements ICommonQuery {
String name = StringUtil.getInfo(search, "name"); String name = StringUtil.getInfo(search, "name");
String type = StringUtil.getInfo(search, "type"); String type = StringUtil.getInfo(search, "type");
String order = QueryUtils.order(map); String order = QueryUtils.order(map);
return functionsService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); return functionService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map));
} }
@Override @Override
...@@ -42,32 +41,32 @@ public class FunctionsComponent implements ICommonQuery { ...@@ -42,32 +41,32 @@ public class FunctionsComponent implements ICommonQuery {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name"); String name = StringUtil.getInfo(search, "name");
String type = StringUtil.getInfo(search, "type"); String type = StringUtil.getInfo(search, "type");
return functionsService.countFunctions(name, type); return functionService.countFunction(name, type);
} }
@Override @Override
public int insert(String beanJson, HttpServletRequest request)throws Exception { public int insert(String beanJson, HttpServletRequest request)throws Exception {
return functionsService.insertFunctions(beanJson, request); return functionService.insertFunction(beanJson, request);
} }
@Override @Override
public int update(String beanJson, Long id, HttpServletRequest request)throws Exception { public int update(String beanJson, Long id, HttpServletRequest request)throws Exception {
return functionsService.updateFunctions(beanJson, id, request); return functionService.updateFunction(beanJson, id, request);
} }
@Override @Override
public int delete(Long id, HttpServletRequest request)throws Exception { public int delete(Long id, HttpServletRequest request)throws Exception {
return functionsService.deleteFunctions(id, request); return functionService.deleteFunction(id, request);
} }
@Override @Override
public int batchDelete(String ids, HttpServletRequest request)throws Exception { public int batchDelete(String ids, HttpServletRequest request)throws Exception {
return functionsService.batchDeleteFunctions(ids, request); return functionService.batchDeleteFunction(ids, request);
} }
@Override @Override
public int checkIsNameExist(Long id, String name)throws Exception { public int checkIsNameExist(Long id, String name)throws Exception {
return functionsService.checkIsNameExist(id, name); return functionService.checkIsNameExist(id, name);
} }
} }
...@@ -7,9 +7,9 @@ import java.lang.annotation.*; ...@@ -7,9 +7,9 @@ import java.lang.annotation.*;
/** /**
* @author jishenghua qq752718920 2018-10-7 15:26:27 * @author jishenghua qq752718920 2018-10-7 15:26:27
*/ */
@ResourceInfo(value = "functions") @ResourceInfo(value = "function")
@Inherited @Inherited
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface FunctionsResource { public @interface FunctionResource {
} }
...@@ -2,14 +2,11 @@ package com.jsh.erp.service.functions; ...@@ -2,14 +2,11 @@ package com.jsh.erp.service.functions;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.Function;
import com.jsh.erp.datasource.entities.DepotItem; import com.jsh.erp.datasource.entities.FunctionExample;
import com.jsh.erp.datasource.entities.Functions;
import com.jsh.erp.datasource.entities.FunctionsExample;
import com.jsh.erp.datasource.entities.User; import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.mappers.FunctionsMapper; import com.jsh.erp.datasource.mappers.FunctionMapper;
import com.jsh.erp.datasource.mappers.FunctionsMapperEx; import com.jsh.erp.datasource.mappers.FunctionMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException; import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
...@@ -28,21 +25,21 @@ import java.util.Date; ...@@ -28,21 +25,21 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
public class FunctionsService { public class FunctionService {
private Logger logger = LoggerFactory.getLogger(FunctionsService.class); private Logger logger = LoggerFactory.getLogger(FunctionService.class);
@Resource @Resource
private FunctionsMapper functionsMapper; private FunctionMapper functionsMapper;
@Resource @Resource
private FunctionsMapperEx functionsMapperEx; private FunctionMapperEx functionMapperEx;
@Resource @Resource
private UserService userService; private UserService userService;
@Resource @Resource
private LogService logService; private LogService logService;
public Functions getFunctions(long id)throws Exception { public Function getFunction(long id)throws Exception {
Functions result=null; Function result=null;
try{ try{
result=functionsMapper.selectByPrimaryKey(id); result=functionsMapper.selectByPrimaryKey(id);
}catch(Exception e){ }catch(Exception e){
...@@ -51,11 +48,11 @@ public class FunctionsService { ...@@ -51,11 +48,11 @@ public class FunctionsService {
return result; return result;
} }
public List<Functions> getFunctionsListByIds(String ids)throws Exception { public List<Function> getFunctionListByIds(String ids)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids); List<Long> idList = StringUtil.strToLongList(ids);
List<Functions> list = new ArrayList<>(); List<Function> list = new ArrayList<>();
try{ try{
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andIdIn(idList); example.createCriteria().andIdIn(idList);
list = functionsMapper.selectByExample(example); list = functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -64,10 +61,10 @@ public class FunctionsService { ...@@ -64,10 +61,10 @@ public class FunctionsService {
return list; return list;
} }
public List<Functions> getFunctions()throws Exception { public List<Function> getFunction()throws Exception {
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Functions> list=null; List<Function> list=null;
try{ try{
list=functionsMapper.selectByExample(example); list=functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -76,20 +73,20 @@ public class FunctionsService { ...@@ -76,20 +73,20 @@ public class FunctionsService {
return list; return list;
} }
public List<Functions> select(String name, String type, int offset, int rows)throws Exception { public List<Function> select(String name, String type, int offset, int rows)throws Exception {
List<Functions> list=null; List<Function> list=null;
try{ try{
list=functionsMapperEx.selectByConditionFunctions(name, type, offset, rows); list= functionMapperEx.selectByConditionFunction(name, type, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
public Long countFunctions(String name, String type)throws Exception { public Long countFunction(String name, String type)throws Exception {
Long result=null; Long result=null;
try{ try{
result=functionsMapperEx.countsByFunctions(name, type); result= functionMapperEx.countsByFunction(name, type);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
...@@ -97,8 +94,8 @@ public class FunctionsService { ...@@ -97,8 +94,8 @@ public class FunctionsService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertFunctions(String beanJson, HttpServletRequest request)throws Exception { public int insertFunction(String beanJson, HttpServletRequest request)throws Exception {
Functions functions = JSONObject.parseObject(beanJson, Functions.class); Function functions = JSONObject.parseObject(beanJson, Function.class);
int result=0; int result=0;
try{ try{
result=functionsMapper.insertSelective(functions); result=functionsMapper.insertSelective(functions);
...@@ -111,8 +108,8 @@ public class FunctionsService { ...@@ -111,8 +108,8 @@ public class FunctionsService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateFunctions(String beanJson, Long id, HttpServletRequest request) throws Exception{ public int updateFunction(String beanJson, Long id, HttpServletRequest request) throws Exception{
Functions functions = JSONObject.parseObject(beanJson, Functions.class); Function functions = JSONObject.parseObject(beanJson, Function.class);
functions.setId(id); functions.setId(id);
int result=0; int result=0;
try{ try{
...@@ -126,7 +123,7 @@ public class FunctionsService { ...@@ -126,7 +123,7 @@ public class FunctionsService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteFunctions(Long id, HttpServletRequest request)throws Exception { public int deleteFunction(Long id, HttpServletRequest request)throws Exception {
int result=0; int result=0;
try{ try{
result=functionsMapper.deleteByPrimaryKey(id); result=functionsMapper.deleteByPrimaryKey(id);
...@@ -139,9 +136,9 @@ public class FunctionsService { ...@@ -139,9 +136,9 @@ public class FunctionsService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteFunctions(String ids, HttpServletRequest request)throws Exception { public int batchDeleteFunction(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids); List<Long> idList = StringUtil.strToLongList(ids);
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andIdIn(idList); example.createCriteria().andIdIn(idList);
int result=0; int result=0;
try{ try{
...@@ -154,9 +151,9 @@ public class FunctionsService { ...@@ -154,9 +151,9 @@ public class FunctionsService {
} }
public int checkIsNameExist(Long id, String name)throws Exception { public int checkIsNameExist(Long id, String name)throws Exception {
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Functions> list=null; List<Function> list=null;
try{ try{
list = functionsMapper.selectByExample(example); list = functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -165,12 +162,12 @@ public class FunctionsService { ...@@ -165,12 +162,12 @@ public class FunctionsService {
return list==null?0:list.size(); return list==null?0:list.size();
} }
public List<Functions> getRoleFunctions(String pNumber)throws Exception { public List<Function> getRoleFunction(String pNumber)throws Exception {
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pNumber) example.createCriteria().andEnabledEqualTo(true).andParentNumberEqualTo(pNumber)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
example.setOrderByClause("Sort"); example.setOrderByClause("Sort");
List<Functions> list=null; List<Function> list=null;
try{ try{
list = functionsMapper.selectByExample(example); list = functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -179,12 +176,12 @@ public class FunctionsService { ...@@ -179,12 +176,12 @@ public class FunctionsService {
return list; return list;
} }
public List<Functions> findRoleFunctions(String pnumber)throws Exception{ public List<Function> findRoleFunction(String pnumber)throws Exception{
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andEnabledEqualTo(true).andPnumberEqualTo(pnumber) example.createCriteria().andEnabledEqualTo(true).andParentNumberEqualTo(pnumber)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
example.setOrderByClause("Sort"); example.setOrderByClause("Sort");
List<Functions> list=null; List<Function> list=null;
try{ try{
list =functionsMapper.selectByExample(example); list =functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -193,13 +190,13 @@ public class FunctionsService { ...@@ -193,13 +190,13 @@ public class FunctionsService {
return list; return list;
} }
public List<Functions> findByIds(String functionsIds)throws Exception{ public List<Function> findByIds(String functionsIds)throws Exception{
List<Long> idList = StringUtil.strToLongList(functionsIds); List<Long> idList = StringUtil.strToLongList(functionsIds);
FunctionsExample example = new FunctionsExample(); FunctionExample example = new FunctionExample();
example.createCriteria().andEnabledEqualTo(true).andIdIn(idList) example.createCriteria().andEnabledEqualTo(true).andIdIn(idList)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
example.setOrderByClause("Sort asc"); example.setOrderByClause("Sort asc");
List<Functions> list=null; List<Function> list=null;
try{ try{
list =functionsMapper.selectByExample(example); list =functionsMapper.selectByExample(example);
}catch(Exception e){ }catch(Exception e){
...@@ -209,11 +206,11 @@ public class FunctionsService { ...@@ -209,11 +206,11 @@ public class FunctionsService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteFunctionsByIds(String ids)throws Exception { public int batchDeleteFunctionByIds(String ids)throws Exception {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE);
List<Functions> list = getFunctionsListByIds(ids); List<Function> list = getFunctionListByIds(ids);
for(Functions functions: list){ for(Function functions: list){
sb.append("[").append(functions.getName()).append("]"); sb.append("[").append(functions.getName()).append("]");
} }
logService.insertLog("功能", sb.toString(), logService.insertLog("功能", sb.toString(),
...@@ -222,7 +219,7 @@ public class FunctionsService { ...@@ -222,7 +219,7 @@ public class FunctionsService {
String [] idArray=ids.split(","); String [] idArray=ids.split(",");
int result=0; int result=0;
try{ try{
result =functionsMapperEx.batchDeleteFunctionsByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); result = functionMapperEx.batchDeleteFunctionByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
......
...@@ -25,20 +25,19 @@ public class LogComponent implements ICommonQuery { ...@@ -25,20 +25,19 @@ public class LogComponent implements ICommonQuery {
@Override @Override
public List<?> select(Map<String, String> map)throws Exception { public List<?> select(Map<String, String> map)throws Exception {
return getUserList(map); return getLogList(map);
} }
private List<?> getUserList(Map<String, String> map)throws Exception { private List<?> getLogList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String operation = StringUtil.getInfo(search, "operation"); String operation = StringUtil.getInfo(search, "operation");
Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID")); Integer userId = StringUtil.parseInteger(StringUtil.getInfo(search, "userId"));
String clientIp = StringUtil.getInfo(search, "clientIp"); String clientIp = StringUtil.getInfo(search, "clientIp");
Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status"));
String beginTime = StringUtil.getInfo(search, "beginTime"); String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime"); String endTime = StringUtil.getInfo(search, "endTime");
String contentdetails = StringUtil.getInfo(search, "contentdetails"); String content = StringUtil.getInfo(search, "content");
String order = QueryUtils.order(map); return logService.select(operation, userId, clientIp, status, beginTime, endTime, content,
return logService.select(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails,
QueryUtils.offset(map), QueryUtils.rows(map)); QueryUtils.offset(map), QueryUtils.rows(map));
} }
...@@ -46,13 +45,13 @@ public class LogComponent implements ICommonQuery { ...@@ -46,13 +45,13 @@ public class LogComponent implements ICommonQuery {
public Long counts(Map<String, String> map)throws Exception { public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String operation = StringUtil.getInfo(search, "operation"); String operation = StringUtil.getInfo(search, "operation");
Integer usernameID = StringUtil.parseInteger(StringUtil.getInfo(search, "usernameID")); Integer userId = StringUtil.parseInteger(StringUtil.getInfo(search, "userId"));
String clientIp = StringUtil.getInfo(search, "clientIp"); String clientIp = StringUtil.getInfo(search, "clientIp");
Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status"));
String beginTime = StringUtil.getInfo(search, "beginTime"); String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime"); String endTime = StringUtil.getInfo(search, "endTime");
String contentdetails = StringUtil.getInfo(search, "contentdetails"); String content = StringUtil.getInfo(search, "content");
return logService.countLog(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails); return logService.countLog(operation, userId, clientIp, status, beginTime, endTime, content);
} }
@Override @Override
......
...@@ -55,15 +55,15 @@ public class LogService { ...@@ -55,15 +55,15 @@ public class LogService {
return list; return list;
} }
public List<LogVo4List> select(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime, public List<LogVo4List> select(String operation, Integer userId, String clientIp, Integer status, String beginTime, String endTime,
String contentdetails, int offset, int rows)throws Exception { String content, int offset, int rows)throws Exception {
List<LogVo4List> list=null; List<LogVo4List> list=null;
try{ try{
list=logMapperEx.selectByConditionLog(operation, usernameID, clientIp, status, beginTime, endTime, list=logMapperEx.selectByConditionLog(operation, userId, clientIp, status, beginTime, endTime,
contentdetails, offset, rows); content, offset, rows);
if (null != list) { if (null != list) {
for (LogVo4List log : list) { for (LogVo4List log : list) {
log.setCreateTimeStr(Tools.getCenternTime(log.getCreatetime())); log.setCreateTimeStr(Tools.getCenternTime(log.getCreateTime()));
} }
} }
}catch(Exception e){ }catch(Exception e){
...@@ -72,11 +72,11 @@ public class LogService { ...@@ -72,11 +72,11 @@ public class LogService {
return list; return list;
} }
public Long countLog(String operation, Integer usernameID, String clientIp, Integer status, String beginTime, String endTime, public Long countLog(String operation, Integer userId, String clientIp, Integer status, String beginTime, String endTime,
String contentdetails)throws Exception { String content)throws Exception {
Long result=null; Long result=null;
try{ try{
result=logMapperEx.countsByLog(operation, usernameID, clientIp, status, beginTime, endTime, contentdetails); result=logMapperEx.countsByLog(operation, userId, clientIp, status, beginTime, endTime, content);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
...@@ -153,13 +153,13 @@ public class LogService { ...@@ -153,13 +153,13 @@ public class LogService {
Long userId = getUserId(request); Long userId = getUserId(request);
if(userId!=null) { if(userId!=null) {
Log log = new Log(); Log log = new Log();
log.setUserid(userId); log.setUserId(userId);
log.setOperation(moduleName); log.setOperation(moduleName);
log.setClientip(getLocalIp(request)); log.setClientIp(getLocalIp(request));
log.setCreatetime(new Date()); log.setCreateTime(new Date());
Byte status = 0; Byte status = 0;
log.setStatus(status); log.setStatus(status);
log.setContentdetails(content); log.setContent(content);
logMapper.insertSelective(log); logMapper.insertSelective(log);
} }
}catch(Exception e){ }catch(Exception e){
......
...@@ -90,7 +90,7 @@ public class MaterialCategoryService { ...@@ -90,7 +90,7 @@ public class MaterialCategoryService {
List<MaterialCategory> res= new ArrayList<MaterialCategory>(); List<MaterialCategory> res= new ArrayList<MaterialCategory>();
List<MaterialCategory> list=null; List<MaterialCategory> list=null;
MaterialCategoryExample example = new MaterialCategoryExample(); MaterialCategoryExample example = new MaterialCategoryExample();
example.createCriteria().andParentidEqualTo(parentId).andIdNotEqualTo(1l); example.createCriteria().andParentIdEqualTo(parentId).andIdNotEqualTo(1L);
example.setOrderByClause("id"); example.setOrderByClause("id");
list=materialCategoryMapper.selectByExample(example); list=materialCategoryMapper.selectByExample(example);
if(list!=null && list.size()>0) { if(list!=null && list.size()>0) {
...@@ -230,9 +230,9 @@ public class MaterialCategoryService { ...@@ -230,9 +230,9 @@ public class MaterialCategoryService {
if(mc==null){ if(mc==null){
return 0; return 0;
} }
if(mc.getParentid()==null){ if(mc.getParentId()==null){
//没有给定父级目录的id,默认设置父级目录为根目录的父目录 //没有给定父级目录的id,默认设置父级目录为根目录的父目录
mc.setParentid(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID);
} }
//检查商品类型编号是否已存在 //检查商品类型编号是否已存在
checkMaterialCategorySerialNo(mc); checkMaterialCategorySerialNo(mc);
...@@ -288,9 +288,9 @@ public class MaterialCategoryService { ...@@ -288,9 +288,9 @@ public class MaterialCategoryService {
logService.insertLog("商品类型", logService.insertLog("商品类型",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getName()).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(mc.getName()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
if(mc.getParentid()==null){ if(mc.getParentId()==null){
//没有给定父级目录的id,默认设置父级目录为根目录的父目录 //没有给定父级目录的id,默认设置父级目录为根目录的父目录
mc.setParentid(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID);
} }
//检查商品类型编号是否已存在 //检查商品类型编号是否已存在
checkMaterialCategorySerialNo(mc); checkMaterialCategorySerialNo(mc);
...@@ -362,7 +362,7 @@ public class MaterialCategoryService { ...@@ -362,7 +362,7 @@ public class MaterialCategoryService {
/** /**
* 校验 * 校验
* 1、产品表 jsh_material * 1、产品表 jsh_material
* 2、产品类型表 jsh_materialcategory * 2、产品类型表 jsh_material_category
* 是否有相关数据 * 是否有相关数据
* */ * */
int deleteTotal=0; int deleteTotal=0;
...@@ -386,7 +386,7 @@ public class MaterialCategoryService { ...@@ -386,7 +386,7 @@ public class MaterialCategoryService {
ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); ExceptionConstants.DELETE_FORCE_CONFIRM_MSG);
} }
/** /**
* 校验产品类型表 jsh_materialcategory * 校验产品类型表 jsh_material_category
* */ * */
List<MaterialCategory> materialCategoryList=null; List<MaterialCategory> materialCategoryList=null;
try{ try{
...@@ -412,7 +412,7 @@ public class MaterialCategoryService { ...@@ -412,7 +412,7 @@ public class MaterialCategoryService {
* @param name * @param name
*/ */
public Long getCategoryIdByName(String name){ public Long getCategoryIdByName(String name){
Long categoryId = 0l; Long categoryId = 0L;
MaterialCategoryExample example = new MaterialCategoryExample(); MaterialCategoryExample example = new MaterialCategoryExample();
example.createCriteria().andNameEqualTo(name).andStatusNotEqualTo(BusinessConstants.DELETE_TYPE_FORCE); example.createCriteria().andNameEqualTo(name).andStatusNotEqualTo(BusinessConstants.DELETE_TYPE_FORCE);
List<MaterialCategory> list = materialCategoryMapper.selectByExample(example); List<MaterialCategory> list = materialCategoryMapper.selectByExample(example);
......
...@@ -88,7 +88,7 @@ public class MaterialPropertyService { ...@@ -88,7 +88,7 @@ public class MaterialPropertyService {
try{ try{
result=materialPropertyMapper.insertSelective(materialProperty); result=materialPropertyMapper.insertSelective(materialProperty);
logService.insertLog("商品属性", logService.insertLog("商品属性",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialProperty.getNativename()).toString(), request); new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(materialProperty.getNativeName()).toString(), request);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
...@@ -103,7 +103,7 @@ public class MaterialPropertyService { ...@@ -103,7 +103,7 @@ public class MaterialPropertyService {
try{ try{
result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty); result=materialPropertyMapper.updateByPrimaryKeySelective(materialProperty);
logService.insertLog("商品属性", logService.insertLog("商品属性",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialProperty.getNativename()).toString(), request); new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(materialProperty.getNativeName()).toString(), request);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
......
...@@ -173,7 +173,7 @@ public class PersonService { ...@@ -173,7 +173,7 @@ public class PersonService {
List<Long> ids = StringUtil.strToLongList(personIDs); List<Long> ids = StringUtil.strToLongList(personIDs);
PersonExample example = new PersonExample(); PersonExample example = new PersonExample();
example.createCriteria().andIdIn(ids).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andIdIn(ids).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
example.setOrderByClause("Id asc"); example.setOrderByClause("id asc");
List<Person> list =null; List<Person> list =null;
try{ try{
list=personMapper.selectByExample(example); list=personMapper.selectByExample(example);
...@@ -192,7 +192,7 @@ public class PersonService { ...@@ -192,7 +192,7 @@ public class PersonService {
public List<Person> getPersonByType(String type)throws Exception { public List<Person> getPersonByType(String type)throws Exception {
PersonExample example = new PersonExample(); PersonExample example = new PersonExample();
example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
example.setOrderByClause("Id asc"); example.setOrderByClause("id asc");
List<Person> list =null; List<Person> list =null;
try{ try{
list=personMapper.selectByExample(example); list=personMapper.selectByExample(example);
......
...@@ -104,7 +104,7 @@ public class UnitService { ...@@ -104,7 +104,7 @@ public class UnitService {
try{ try{
result=unitMapper.insertSelective(unit); result=unitMapper.insertSelective(unit);
logService.insertLog("计量单位", logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(unit.getUname()).toString(), request); new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(unit.getName()).toString(), request);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
...@@ -119,7 +119,7 @@ public class UnitService { ...@@ -119,7 +119,7 @@ public class UnitService {
try{ try{
result=unitMapper.updateByPrimaryKeySelective(unit); result=unitMapper.updateByPrimaryKeySelective(unit);
logService.insertLog("计量单位", logService.insertLog("计量单位",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(unit.getUname()).toString(), request); new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(unit.getName()).toString(), request);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
...@@ -156,7 +156,7 @@ public class UnitService { ...@@ -156,7 +156,7 @@ public class UnitService {
public int checkIsNameExist(Long id, String name)throws Exception { public int checkIsNameExist(Long id, String name)throws Exception {
UnitExample example = new UnitExample(); UnitExample example = new UnitExample();
example.createCriteria().andIdNotEqualTo(id).andUnameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Unit> list=null; List<Unit> list=null;
try{ try{
list=unitMapper.selectByExample(example); list=unitMapper.selectByExample(example);
...@@ -171,7 +171,7 @@ public class UnitService { ...@@ -171,7 +171,7 @@ public class UnitService {
sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE);
List<Unit> list = getUnitListByIds(ids); List<Unit> list = getUnitListByIds(ids);
for(Unit unit: list){ for(Unit unit: list){
sb.append("[").append(unit.getUname()).append("]"); sb.append("[").append(unit.getName()).append("]");
} }
logService.insertLog("计量单位", sb.toString(), logService.insertLog("计量单位", sb.toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
...@@ -234,9 +234,9 @@ public class UnitService { ...@@ -234,9 +234,9 @@ public class UnitService {
* @param name * @param name
*/ */
public Long getUnitIdByName(String name){ public Long getUnitIdByName(String name){
Long unitId = 0l; Long unitId = 0L;
UnitExample example = new UnitExample(); UnitExample example = new UnitExample();
example.createCriteria().andUnameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); example.createCriteria().andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Unit> list = unitMapper.selectByExample(example); List<Unit> list = unitMapper.selectByExample(example);
if(list!=null && list.size()>0) { if(list!=null && list.size()>0) {
unitId = list.get(0).getId(); unitId = list.get(0).getId();
......
...@@ -2,14 +2,12 @@ package com.jsh.erp.service.userBusiness; ...@@ -2,14 +2,12 @@ package com.jsh.erp.service.userBusiness;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.datasource.mappers.UserBusinessMapper; import com.jsh.erp.datasource.mappers.UserBusinessMapper;
import com.jsh.erp.datasource.mappers.UserBusinessMapperEx; import com.jsh.erp.datasource.mappers.UserBusinessMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException; import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.CommonQueryManager; import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.service.functions.FunctionsService; import com.jsh.erp.service.functions.FunctionService;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
...@@ -17,7 +15,6 @@ import org.slf4j.Logger; ...@@ -17,7 +15,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
...@@ -39,7 +36,7 @@ public class UserBusinessService { ...@@ -39,7 +36,7 @@ public class UserBusinessService {
private UserService userService; private UserService userService;
@Resource @Resource
private FunctionsService functionsService; private FunctionService functionService;
@Resource @Resource
private CommonQueryManager configResourceManager; private CommonQueryManager configResourceManager;
...@@ -127,7 +124,7 @@ public class UserBusinessService { ...@@ -127,7 +124,7 @@ public class UserBusinessService {
public List<UserBusiness> getBasicData(String keyId, String type)throws Exception{ public List<UserBusiness> getBasicData(String keyId, String type)throws Exception{
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andKeyidEqualTo(keyId).andTypeEqualTo(type) example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<UserBusiness> list=null; List<UserBusiness> list=null;
try{ try{
...@@ -140,7 +137,7 @@ public class UserBusinessService { ...@@ -140,7 +137,7 @@ public class UserBusinessService {
public Long checkIsValueExist(String type, String keyId)throws Exception { public Long checkIsValueExist(String type, String keyId)throws Exception {
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andTypeEqualTo(type).andKeyidEqualTo(keyId) example.createCriteria().andTypeEqualTo(type).andKeyIdEqualTo(keyId)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<UserBusiness> list=null; List<UserBusiness> list=null;
try{ try{
...@@ -159,7 +156,7 @@ public class UserBusinessService { ...@@ -159,7 +156,7 @@ public class UserBusinessService {
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
String newVaule = "%" + UBValue + "%"; String newVaule = "%" + UBValue + "%";
if(TypeVale !=null && KeyIdValue !=null) { if(TypeVale !=null && KeyIdValue !=null) {
example.createCriteria().andTypeEqualTo(TypeVale).andKeyidEqualTo(KeyIdValue).andValueLike(newVaule) example.createCriteria().andTypeEqualTo(TypeVale).andKeyIdEqualTo(KeyIdValue).andValueLike(newVaule)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
} else { } else {
example.createCriteria().andValueLike(newVaule) example.createCriteria().andValueLike(newVaule)
...@@ -184,7 +181,7 @@ public class UserBusinessService { ...@@ -184,7 +181,7 @@ public class UserBusinessService {
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(), new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(userBusinessId).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
UserBusiness userBusiness = new UserBusiness(); UserBusiness userBusiness = new UserBusiness();
userBusiness.setBtnstr(btnStr); userBusiness.setBtnStr(btnStr);
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andIdEqualTo(userBusinessId); example.createCriteria().andIdEqualTo(userBusinessId);
int result=0; int result=0;
...@@ -198,7 +195,7 @@ public class UserBusinessService { ...@@ -198,7 +195,7 @@ public class UserBusinessService {
public List<UserBusiness> findRoleByUserId(String userId)throws Exception{ public List<UserBusiness> findRoleByUserId(String userId)throws Exception{
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andKeyidEqualTo(userId).andTypeEqualTo("UserRole") example.createCriteria().andKeyIdEqualTo(userId).andTypeEqualTo("UserRole")
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<UserBusiness> list=null; List<UserBusiness> list=null;
try{ try{
...@@ -212,7 +209,7 @@ public class UserBusinessService { ...@@ -212,7 +209,7 @@ public class UserBusinessService {
public List<UserBusiness> findAppByRoles(String roles)throws Exception{ public List<UserBusiness> findAppByRoles(String roles)throws Exception{
List<String> rolesList = StringUtil.strToStringList(roles); List<String> rolesList = StringUtil.strToStringList(roles);
UserBusinessExample example = new UserBusinessExample(); UserBusinessExample example = new UserBusinessExample();
example.createCriteria().andKeyidIn(rolesList).andTypeEqualTo("RoleAPP") example.createCriteria().andKeyIdIn(rolesList).andTypeEqualTo("RoleAPP")
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<UserBusiness> list=null; List<UserBusiness> list=null;
try{ try{
......
<?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.jsh.erp.datasource.mappers.AccountMapper"> <mapper namespace="com.jsh.erp.datasource.mappers.AccountMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Account"> <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Account">
<!-- <id column="id" jdbcType="BIGINT" property="id" />
WARNING - @mbggenerated <result column="name" jdbcType="VARCHAR" property="name" />
This element is automatically generated by MyBatis Generator, do not modify. <result column="serial_no" jdbcType="VARCHAR" property="serialNo" />
--> <result column="initial_amount" jdbcType="DECIMAL" property="initialAmount" />
<id column="Id" jdbcType="BIGINT" property="id" /> <result column="current_amount" jdbcType="DECIMAL" property="currentAmount" />
<result column="Name" jdbcType="VARCHAR" property="name" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="SerialNo" jdbcType="VARCHAR" property="serialno" /> <result column="is_default" jdbcType="BIT" property="isDefault" />
<result column="InitialAmount" jdbcType="DECIMAL" property="initialamount" /> <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="CurrentAmount" jdbcType="DECIMAL" property="currentamount" /> <result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="Remark" jdbcType="VARCHAR" property="remark" /> </resultMap>
<result column="IsDefault" jdbcType="BIT" property="isdefault" /> <sql id="Example_Where_Clause">
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> <where>
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" /> <foreach collection="oredCriteria" item="criteria" separator="or">
</resultMap> <if test="criteria.valid">
<sql id="Example_Where_Clause"> <trim prefix="(" prefixOverrides="and" suffix=")">
<!-- <foreach collection="criteria.criteria" item="criterion">
WARNING - @mbggenerated <choose>
This element is automatically generated by MyBatis Generator, do not modify. <when test="criterion.noValue">
--> and ${criterion.condition}
<where> </when>
<foreach collection="oredCriteria" item="criteria" separator="or"> <when test="criterion.singleValue">
<if test="criteria.valid"> and ${criterion.condition} #{criterion.value}
<trim prefix="(" prefixOverrides="and" suffix=")"> </when>
<foreach collection="criteria.criteria" item="criterion"> <when test="criterion.betweenValue">
<choose> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<when test="criterion.noValue"> </when>
and ${criterion.condition} <when test="criterion.listValue">
</when> and ${criterion.condition}
<when test="criterion.singleValue"> <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
and ${criterion.condition} #{criterion.value} #{listItem}
</when> </foreach>
<when test="criterion.betweenValue"> </when>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </choose>
</when> </foreach>
<when test="criterion.listValue"> </trim>
and ${criterion.condition} </if>
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </where>
</foreach> </sql>
</when> <sql id="Update_By_Example_Where_Clause">
</choose> <where>
</foreach> <foreach collection="example.oredCriteria" item="criteria" separator="or">
</trim> <if test="criteria.valid">
</if> <trim prefix="(" prefixOverrides="and" suffix=")">
</foreach> <foreach collection="criteria.criteria" item="criterion">
</where> <choose>
</sql> <when test="criterion.noValue">
<sql id="Update_By_Example_Where_Clause"> and ${criterion.condition}
<!-- </when>
WARNING - @mbggenerated <when test="criterion.singleValue">
This element is automatically generated by MyBatis Generator, do not modify. and ${criterion.condition} #{criterion.value}
--> </when>
<where> <when test="criterion.betweenValue">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<if test="criteria.valid"> </when>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.listValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<when test="criterion.noValue"> #{listItem}
and ${criterion.condition} </foreach>
</when> </when>
<when test="criterion.singleValue"> </choose>
and ${criterion.condition} #{criterion.value} </foreach>
</when> </trim>
<when test="criterion.betweenValue"> </if>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </foreach>
</when> </where>
<when test="criterion.listValue"> </sql>
and ${criterion.condition} <sql id="Base_Column_List">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> id, name, serial_no, initial_amount, current_amount, remark, is_default, tenant_id,
#{listItem} delete_flag
</foreach> </sql>
</when> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="BaseResultMap">
</choose> select
</foreach> <if test="distinct">
</trim> distinct
</if> </if>
</foreach> <include refid="Base_Column_List" />
</where> from jsh_account
</sql> <if test="_parameter != null">
<sql id="Base_Column_List"> <include refid="Example_Where_Clause" />
<!-- </if>
WARNING - @mbggenerated <if test="orderByClause != null">
This element is automatically generated by MyBatis Generator, do not modify. order by ${orderByClause}
--> </if>
Id, Name, SerialNo, InitialAmount, CurrentAmount, Remark, IsDefault, tenant_id, delete_Flag </select>
</sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="BaseResultMap"> select
<!-- <include refid="Base_Column_List" />
WARNING - @mbggenerated from jsh_account
This element is automatically generated by MyBatis Generator, do not modify. where id = #{id,jdbcType=BIGINT}
--> </select>
select <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<if test="distinct"> delete from jsh_account
distinct where id = #{id,jdbcType=BIGINT}
</if> </delete>
<include refid="Base_Column_List" /> <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample">
from jsh_account delete from jsh_account
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
<if test="orderByClause != null"> </delete>
order by ${orderByClause} <insert id="insert" parameterType="com.jsh.erp.datasource.entities.Account">
</if> insert into jsh_account (id, name, serial_no,
</select> initial_amount, current_amount, remark,
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> is_default, tenant_id, delete_flag
<!-- )
WARNING - @mbggenerated values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
This element is automatically generated by MyBatis Generator, do not modify. #{initialAmount,jdbcType=DECIMAL}, #{currentAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
--> #{isDefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
select )
<include refid="Base_Column_List" /> </insert>
from jsh_account <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Account">
where Id = #{id,jdbcType=BIGINT} insert into jsh_account
</select> <trim prefix="(" suffix=")" suffixOverrides=",">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <if test="id != null">
<!-- id,
WARNING - @mbggenerated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="name != null">
--> name,
delete from jsh_account </if>
where Id = #{id,jdbcType=BIGINT} <if test="serialNo != null">
</delete> serial_no,
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample"> </if>
<!-- <if test="initialAmount != null">
WARNING - @mbggenerated initial_amount,
This element is automatically generated by MyBatis Generator, do not modify. </if>
--> <if test="currentAmount != null">
delete from jsh_account current_amount,
<if test="_parameter != null"> </if>
<include refid="Example_Where_Clause" /> <if test="remark != null">
</if> remark,
</delete> </if>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Account"> <if test="isDefault != null">
<!-- is_default,
WARNING - @mbggenerated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="tenantId != null">
--> tenant_id,
insert into jsh_account (Id, Name, SerialNo, </if>
InitialAmount, CurrentAmount, Remark, <if test="deleteFlag != null">
IsDefault, tenant_id, delete_Flag delete_flag,
) </if>
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialno,jdbcType=VARCHAR}, </trim>
#{initialamount,jdbcType=DECIMAL}, #{currentamount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, <trim prefix="values (" suffix=")" suffixOverrides=",">
#{isdefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} <if test="id != null">
) #{id,jdbcType=BIGINT},
</insert> </if>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Account"> <if test="name != null">
<!-- #{name,jdbcType=VARCHAR},
WARNING - @mbggenerated </if>
This element is automatically generated by MyBatis Generator, do not modify. <if test="serialNo != null">
--> #{serialNo,jdbcType=VARCHAR},
insert into jsh_account </if>
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="initialAmount != null">
<if test="id != null"> #{initialAmount,jdbcType=DECIMAL},
Id, </if>
</if> <if test="currentAmount != null">
<if test="name != null"> #{currentAmount,jdbcType=DECIMAL},
Name, </if>
</if> <if test="remark != null">
<if test="serialno != null"> #{remark,jdbcType=VARCHAR},
SerialNo, </if>
</if> <if test="isDefault != null">
<if test="initialamount != null"> #{isDefault,jdbcType=BIT},
InitialAmount, </if>
</if> <if test="tenantId != null">
<if test="currentamount != null"> #{tenantId,jdbcType=BIGINT},
CurrentAmount, </if>
</if> <if test="deleteFlag != null">
<if test="remark != null"> #{deleteFlag,jdbcType=VARCHAR},
Remark, </if>
</if> </trim>
<if test="isdefault != null"> </insert>
IsDefault, <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultType="java.lang.Long">
</if> select count(*) from jsh_account
<if test="tenantId != null"> <if test="_parameter != null">
tenant_id, <include refid="Example_Where_Clause" />
</if> </if>
<if test="deleteFlag != null"> </select>
delete_Flag, <update id="updateByExampleSelective" parameterType="map">
</if> update jsh_account
</trim> <set>
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="record.id != null">
<if test="id != null"> id = #{record.id,jdbcType=BIGINT},
#{id,jdbcType=BIGINT}, </if>
</if> <if test="record.name != null">
<if test="name != null"> name = #{record.name,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, </if>
</if> <if test="record.serialNo != null">
<if test="serialno != null"> serial_no = #{record.serialNo,jdbcType=VARCHAR},
#{serialno,jdbcType=VARCHAR}, </if>
</if> <if test="record.initialAmount != null">
<if test="initialamount != null"> initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
#{initialamount,jdbcType=DECIMAL}, </if>
</if> <if test="record.currentAmount != null">
<if test="currentamount != null"> current_amount = #{record.currentAmount,jdbcType=DECIMAL},
#{currentamount,jdbcType=DECIMAL}, </if>
</if> <if test="record.remark != null">
<if test="remark != null"> remark = #{record.remark,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, </if>
</if> <if test="record.isDefault != null">
<if test="isdefault != null"> is_default = #{record.isDefault,jdbcType=BIT},
#{isdefault,jdbcType=BIT}, </if>
</if> <if test="record.tenantId != null">
<if test="tenantId != null"> tenant_id = #{record.tenantId,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, </if>
</if> <if test="record.deleteFlag != null">
<if test="deleteFlag != null"> delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=VARCHAR}, </if>
</if> </set>
</trim> <if test="_parameter != null">
</insert> <include refid="Update_By_Example_Where_Clause" />
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultType="java.lang.Integer"> </if>
<!-- </update>
WARNING - @mbggenerated <update id="updateByExample" parameterType="map">
This element is automatically generated by MyBatis Generator, do not modify. update jsh_account
--> set id = #{record.id,jdbcType=BIGINT},
select count(*) from jsh_account name = #{record.name,jdbcType=VARCHAR},
<if test="_parameter != null"> serial_no = #{record.serialNo,jdbcType=VARCHAR},
<include refid="Example_Where_Clause" /> initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
</if> current_amount = #{record.currentAmount,jdbcType=DECIMAL},
</select> remark = #{record.remark,jdbcType=VARCHAR},
<update id="updateByExampleSelective" parameterType="map"> is_default = #{record.isDefault,jdbcType=BIT},
<!-- tenant_id = #{record.tenantId,jdbcType=BIGINT},
WARNING - @mbggenerated delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
This element is automatically generated by MyBatis Generator, do not modify. <if test="_parameter != null">
--> <include refid="Update_By_Example_Where_Clause" />
update jsh_account </if>
<set> </update>
<if test="record.id != null"> <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Account">
Id = #{record.id,jdbcType=BIGINT}, update jsh_account
</if> <set>
<if test="record.name != null"> <if test="name != null">
Name = #{record.name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="record.serialno != null"> <if test="serialNo != null">
SerialNo = #{record.serialno,jdbcType=VARCHAR}, serial_no = #{serialNo,jdbcType=VARCHAR},
</if> </if>
<if test="record.initialamount != null"> <if test="initialAmount != null">
InitialAmount = #{record.initialamount,jdbcType=DECIMAL}, initial_amount = #{initialAmount,jdbcType=DECIMAL},
</if> </if>
<if test="record.currentamount != null"> <if test="currentAmount != null">
CurrentAmount = #{record.currentamount,jdbcType=DECIMAL}, current_amount = #{currentAmount,jdbcType=DECIMAL},
</if> </if>
<if test="record.remark != null"> <if test="remark != null">
Remark = #{record.remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.isdefault != null"> <if test="isDefault != null">
IsDefault = #{record.isdefault,jdbcType=BIT}, is_default = #{isDefault,jdbcType=BIT},
</if> </if>
<if test="record.tenantId != null"> <if test="tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT}, tenant_id = #{tenantId,jdbcType=BIGINT},
</if> </if>
<if test="record.deleteFlag != null"> <if test="deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if> </if>
</set> </set>
<if test="_parameter != null"> where id = #{id,jdbcType=BIGINT}
<include refid="Update_By_Example_Where_Clause" /> </update>
</if> <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Account">
</update> update jsh_account
<update id="updateByExample" parameterType="map"> set name = #{name,jdbcType=VARCHAR},
<!-- serial_no = #{serialNo,jdbcType=VARCHAR},
WARNING - @mbggenerated initial_amount = #{initialAmount,jdbcType=DECIMAL},
This element is automatically generated by MyBatis Generator, do not modify. current_amount = #{currentAmount,jdbcType=DECIMAL},
--> remark = #{remark,jdbcType=VARCHAR},
update jsh_account is_default = #{isDefault,jdbcType=BIT},
set Id = #{record.id,jdbcType=BIGINT}, tenant_id = #{tenantId,jdbcType=BIGINT},
Name = #{record.name,jdbcType=VARCHAR}, delete_flag = #{deleteFlag,jdbcType=VARCHAR}
SerialNo = #{record.serialno,jdbcType=VARCHAR}, where id = #{id,jdbcType=BIGINT}
InitialAmount = #{record.initialamount,jdbcType=DECIMAL}, </update>
CurrentAmount = #{record.currentamount,jdbcType=DECIMAL},
Remark = #{record.remark,jdbcType=VARCHAR},
IsDefault = #{record.isdefault,jdbcType=BIT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Account">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
<set>
<if test="name != null">
Name = #{name,jdbcType=VARCHAR},
</if>
<if test="serialno != null">
SerialNo = #{serialno,jdbcType=VARCHAR},
</if>
<if test="initialamount != null">
InitialAmount = #{initialamount,jdbcType=DECIMAL},
</if>
<if test="currentamount != null">
CurrentAmount = #{currentamount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="isdefault != null">
IsDefault = #{isdefault,jdbcType=BIT},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Account">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_account
set Name = #{name,jdbcType=VARCHAR},
SerialNo = #{serialno,jdbcType=VARCHAR},
InitialAmount = #{initialamount,jdbcType=DECIMAL},
CurrentAmount = #{currentamount,jdbcType=DECIMAL},
Remark = #{remark,jdbcType=VARCHAR},
IsDefault = #{isdefault,jdbcType=BIT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!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.jsh.erp.datasource.mappers.AccountMapperEx"> <mapper namespace="com.jsh.erp.datasource.mappers.AccountMapperEx">
<resultMap extends="com.jsh.erp.datasource.mappers.AccountMapper.BaseResultMap" id="ResultListMap" type="com.jsh.erp.datasource.vo.AccountVo4List"> <resultMap extends="com.jsh.erp.datasource.mappers.AccountMapper.BaseResultMap" id="ResultListMap" type="com.jsh.erp.datasource.vo.AccountVo4List">
<result column="thismonthamount" jdbcType="VARCHAR" property="thismonthamount" /> <result column="thisMonthAmount" jdbcType="VARCHAR" property="thisMonthAmount" />
</resultMap> </resultMap>
<resultMap id="ResultInOutList" type="com.jsh.erp.datasource.vo.AccountVo4InOutList"> <resultMap id="ResultInOutList" type="com.jsh.erp.datasource.vo.AccountVo4InOutList">
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
and name like '%${name}%' and name like '%${name}%'
</if> </if>
<if test="serialNo != null"> <if test="serialNo != null">
and SerialNo like '%${serialNo}%' and serial_no like '%${serialNo}%'
</if> </if>
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
and name like '%${name}%' and name like '%${name}%'
</if> </if>
<if test="serialNo != null"> <if test="serialNo != null">
and SerialNo like '%${serialNo}%' and serial_no like '%${serialNo}%'
</if> </if>
<if test="remark != null"> <if test="remark != null">
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
and ifnull(delete_Flag,'0') !='1' and ifnull(delete_flag,'0') !='1'
</select> </select>
<select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList"> <select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList">
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
</select> </select>
<update id="batchDeleteAccountByIds"> <update id="batchDeleteAccountByIds">
update jsh_account update jsh_account
set delete_Flag='1' set delete_flag='1'
where 1=1 where 1=1
and id in ( and id in (
<foreach collection="ids" item="id" separator=","> <foreach collection="ids" item="id" separator=",">
......
...@@ -207,9 +207,9 @@ ...@@ -207,9 +207,9 @@
) priceSum ) priceSum
from jsh_depothead dh from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
from jsh_material from jsh_material
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2' LEFT JOIN jsh_material_category on jsh_material.CategoryId=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1'
) m ) m
on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}' on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
...@@ -233,9 +233,9 @@ ...@@ -233,9 +233,9 @@
select count(1) from select count(1) from
(select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh (select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1' INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
from jsh_material from jsh_material
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2' LEFT JOIN jsh_material_category on jsh_material.CategoryId=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1' where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}' ) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
<if test="oId != null"> <if test="oId != null">
......
...@@ -28,16 +28,17 @@ ...@@ -28,16 +28,17 @@
<result column="DepotName" jdbcType="VARCHAR" property="DepotName" /> <result column="DepotName" jdbcType="VARCHAR" property="DepotName" />
<result column="AnotherDepotName" jdbcType="VARCHAR" property="AnotherDepotName" /> <result column="AnotherDepotName" jdbcType="VARCHAR" property="AnotherDepotName" />
<result column="UnitId" jdbcType="BIGINT" property="UnitId" /> <result column="UnitId" jdbcType="BIGINT" property="UnitId" />
<result column="UName" jdbcType="VARCHAR" property="UName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="barCode" jdbcType="VARCHAR" property="barCode" /> <result column="barCode" jdbcType="VARCHAR" property="barCode" />
</resultMap> </resultMap>
<resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultByMaterial" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx"> <resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultByMaterial" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx">
<result column="MId" jdbcType="VARCHAR" property="MId" /> <result column="MId" jdbcType="VARCHAR" property="MId" />
<result column="MName" jdbcType="VARCHAR" property="MName" /> <result column="MName" jdbcType="VARCHAR" property="MName" />
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
<result column="MModel" jdbcType="VARCHAR" property="MModel" /> <result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" /> <result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="UName" jdbcType="VARCHAR" property="UName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" /> <result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" /> <result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
</resultMap> </resultMap>
...@@ -139,7 +140,7 @@ ...@@ -139,7 +140,7 @@
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs, select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3, m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.UName, me.bar_code barCode dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, me.bar_code barCode
from jsh_depotitem di from jsh_depotitem di
left join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1' left join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
...@@ -152,8 +153,8 @@ ...@@ -152,8 +153,8 @@
</select> </select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor, select m.id MId, m.Name MName, m.Mfrs MMfrs, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
me.purchase_decimal, u.UName UName me.purchase_decimal, u.name unit_name
from jsh_material m from jsh_material m
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1' left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1' left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
...@@ -171,7 +172,7 @@ ...@@ -171,7 +172,7 @@
and dh.OperTime &lt;= '${endTime}' and dh.OperTime &lt;= '${endTime}'
</if> </if>
and ifnull(di.delete_Flag,'0') !='1' and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.UName group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.name
order by m.Name, m.Model asc order by m.Name, m.Model asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
...@@ -381,7 +382,7 @@ ...@@ -381,7 +382,7 @@
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0)) BasicLinjieNumber (IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0)) BasicLinjieNumber
FROM FROM
jsh_material m jsh_material m
LEFT JOIN jsh_materialcategory mc ON mc.Id = m.CategoryId LEFT JOIN jsh_material_category mc ON mc.Id = m.CategoryId
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
di.MaterialId, di.MaterialId,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment