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

优化表结构

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