| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProductLockLogMapper; |
| | | import com.whyc.pojo.ProductLockLog; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.aspectj.weaver.ast.And; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProductLockLogService { |
| | |
| | | public void insert(ProductLockLog lockLog) { |
| | | mapper.insert(lockLog); |
| | | } |
| | | |
| | | public void insertBatch(List<ProductLockLog> lockLogs){ |
| | | mapper.insertBatchSomeColumn(lockLogs); |
| | | } |
| | | |
| | | public List<ProductLockLog> getListByParentCodeAndCustomCode(String parentCode, String customCode) { |
| | | QueryWrapper<ProductLockLog> query = Wrappers.query(); |
| | | query.eq("parent_code",parentCode).eq("custom_code",customCode).orderByDesc("id"); |
| | | return mapper.selectList(query); |
| | | } |
| | | //查询列表-查询用户的解锁操作 |
| | | public Response getUnlockByOwner(Date testTime1, Date testTime2, int pageCurr, int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | String uName= ActionUtil.getUser().getName(); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("owner",uName); |
| | | wrapper.in("lock_flag",0,1); |
| | | wrapper.le("create_time",testTime2); |
| | | wrapper.ge("create_time",testTime1); |
| | | wrapper.orderByDesc("create_time"); |
| | | List list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询用户的解锁操作"); |
| | | } |
| | | } |