Browse Source

后端整合模块

detached
huangqizhen 5 months ago
parent
commit
670a5fbf17
  1. 8
      src/main/java/com/example/demo/mapper/ConsumeMapper.java
  2. 9
      src/main/java/com/example/demo/mapper/DetailYMapper.java
  3. 5
      src/main/java/com/example/demo/serviceImpl/DetailYServiceImpl.java
  4. 5
      src/main/java/com/example/demo/sevice/DetailYService.java

8
src/main/java/com/example/demo/mapper/ConsumeMapper.java

@ -42,11 +42,11 @@ public interface ConsumeMapper {
@Select({
"<script>",
"select detail_y.*,admin.name as adminName ,admin.area as area ,user.name as userName,product.name as productName from detail_y ",
"inner join admin on detail_y.admin_id=admin.admin_id ",
"inner join user on detail_y.jwcode= user.jwcode ",
"inner join product on detail_y.product_id= product.product_id ",
"Left join admin on detail_y.admin_id=admin.admin_id ",
"Left join user on detail_y.jwcode= user.jwcode ",
"Left join product on detail_y.product_id= product.product_id ",
"<where>",
"`detail_flag`=1 AND update_type = '1'",
// "`detail_flag`=1 AND update_type = '1'",
"<if test='jwcode!=null'>and detail.jwcode =#{jwcode}</if>",
"<if test='productName!=null'>and product.name like concat('%',#{productName},'%')</if>",
"<if test='consumePlatform!=null'>and detail_y.consume_platform like concat('%',#{consumePlatform},'%')</if>",

9
src/main/java/com/example/demo/mapper/DetailYMapper.java

@ -54,12 +54,11 @@ public interface DetailYMapper {
"FROM",
"`detail_y`",
"<where>",
"<if test='jwcode!=null and jwcode.length>0'>and detail_y.jwcode=#{jwcode}</if>",
"<if test='updateType!=null'>and update_type=#{updateType}</if>",
"<if test='startDate != null and endDate != null'>AND detail_y.create_time BETWEEN #{startDate} AND #{endDate}</if>",
"<if test='jwcode!=null and jwcode.length>0'>AND jwcode=#{jwcode}</if>",
"<if test='updateType!=null'>AND update_type=#{updateType}</if>",
"<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>",
"</where>",
"</script>"
})
int getCount(DetailY detailY);
DetailY getCount(DetailY detailY);
}

5
src/main/java/com/example/demo/serviceImpl/DetailYServiceImpl.java

@ -1,14 +1,11 @@
package com.example.demo.serviceImpl;
import com.example.demo.domain.entity.Detail;
import com.example.demo.domain.entity.DetailY;
import com.example.demo.mapper.DetailMapper;
import com.example.demo.mapper.DetailYMapper;
import com.example.demo.sevice.DetailYService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@ -30,7 +27,7 @@ public class DetailYServiceImpl implements DetailYService {
}
@Override
public int getCount(DetailY detailY) {
public DetailY getCount(DetailY detailY) {
return detailYMapper.getCount(detailY);
}

5
src/main/java/com/example/demo/sevice/DetailYService.java

@ -1,13 +1,10 @@
package com.example.demo.sevice;
import com.example.demo.domain.entity.Detail;
import com.example.demo.domain.entity.DetailY;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface DetailYService {
int add(DetailY detailY);
int getCount(DetailY detailY);
DetailY getCount(DetailY detailY);
PageInfo<DetailY> getDetailByPage(int pageNum, int pageSize, DetailY detailY);
}
Loading…
Cancel
Save