修改用户账单sql

This commit is contained in:
xuwenbo
2020-09-05 18:11:26 +08:00
parent 5e57a726fe
commit eb661972eb
2 changed files with 7 additions and 7 deletions

View File

@ -274,13 +274,13 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
@Override @Override
public List<YxUserBillDto> queryAll(YxUserBillQueryCriteria criteria){ public List<YxUserBillDto> queryAll(YxUserBillQueryCriteria criteria){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Integer date =null; String date =null;
Integer date1 = null; String date1 = null;
if(StringUtils.isNotEmpty(criteria.getStartTime())){ if(StringUtils.isNotEmpty(criteria.getStartTime())){
try { try {
date = OrderUtil.dateToTimestamp(sdf.parse(criteria.getStartTime())); date = sdf.parse(criteria.getStartTime())+ " 00:00:00";
if(StringUtils.isNotEmpty(criteria.getEndTime())){ if(StringUtils.isNotEmpty(criteria.getEndTime())){
date1 = OrderUtil.dateToTimestamp(sdf.parse(criteria.getEndTime()))+24*60*60; date1 =sdf.parse(criteria.getEndTime())+ " 23:59:59";
} }
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -84,8 +84,8 @@ public interface UserBillMapper extends CoreMapper<YxUserBill> {
"<if test =\"type !=''\">and b.type=#{type}</if> " + "<if test =\"type !=''\">and b.type=#{type}</if> " +
"<if test =\"title !=''\">and b.title=#{title}</if> " + "<if test =\"title !=''\">and b.title=#{title}</if> " +
"<if test =\"pm !=null\">and b.pm=#{pm}</if> " + "<if test =\"pm !=null\">and b.pm=#{pm}</if> " +
"<if test =\"date !=null\">and b.add_time &gt;= ${date}</if> " + "<if test =\"date !=null\">and b.create_time &gt;= STR_TO_DATE(#{date},'%Y-%m-%d %H:%i:%s')</if> " +
"<if test =\"date1 !=null\">and b.add_time &lt;= ${date1}</if> " + "<if test =\"date1 !=null\">and b.create_time &lt;=STR_TO_DATE(#{date1},'%Y-%m-%d %H:%i:%s')</if> " +
"<if test =\"nickname !=''\">and u.nickname LIKE CONCAT('%',#{nickname},'%')</if> </script> ") "<if test =\"nickname !=''\">and u.nickname LIKE CONCAT('%',#{nickname},'%')</if> </script> ")
List<YxUserBillDto> findAllByQueryCriteria(@Param("category") String category, @Param("type") String type, @Param("nickname") String nickname, @Param("pm") Integer pm, @Param("date")Integer date, @Param("date1")Integer date1,@Param("title")String title); List<YxUserBillDto> findAllByQueryCriteria(@Param("category") String category, @Param("type") String type, @Param("nickname") String nickname, @Param("pm") Integer pm, @Param("date")String date, @Param("date1")String date1,@Param("title")String title);
} }