| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.dto.UseRecordDTO; |
| | | import com.google.common.collect.Lists; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LWhProcureModelUserServiceImpl |
| | | * @Author cy |
| | | * @Date 2023/11/3 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: TODO |
| | | * @date 2023/11/2 16:21 |
| | | */ |
| | | @Service |
| | | public class LWhProcureModelUserServiceImpl extends BaseServiceImpl { |
| | | |
| | | public List<UseRecordDTO> selectUseRecord(Long businessId) { |
| | | String sql = "SELECT\n" |
| | | + "\tpmur.ID,\n" |
| | | + "\tpm.ID procureModelId,\n" |
| | | + "\tpmur.DEAL_TIME updateTime,\n" |
| | | + "\tpmur.OPERATOR_NAME updateUserName,\n" |
| | | + "\tpm.BASE_GOODS_MODELS_ID,\n" |
| | | + "\tpm.BASE_GOODS_MODELS_NAME,\n" |
| | | + "\tbgm.UNIT,\n" |
| | | + "\tpmu.GOODS_NUM num,\n" |
| | | + "\tpmu.NOW_USER_NAME useName,\n" |
| | | + "\tpmu.NOW_USER_PHONE phone\n" |
| | | + "FROM\n" |
| | | + "\tl_wh_procure_model_user pmu\n" |
| | | + "\tINNER JOIN l_wh_procure_model_user_record pmur ON pmu.PROCURE_MODEL_USER_RECORD_ID = pmur.id\n" |
| | | + "\tINNER JOIN l_wh_procure_model pm ON pm.id = pmu.WH_PROCURE_MODEL_ID\n" |
| | | + "\tINNER JOIN base_goods_models bgm ON pm.BASE_GOODS_MODELS_ID = bgm.id\n" |
| | | + "\tWHERE pm.BUSINESS_ID =:id order by pmur.DEAL_TIME desc "; |
| | | Map<String, Object> procureModelId = new HashMap<>(); |
| | | procureModelId.put("id", businessId); |
| | | List<Map<String, Object>> select = this.select(sql, procureModelId, new MapperUtil()); |
| | | List<UseRecordDTO> useRecordDTOList = Lists.newArrayList(); |
| | | select.forEach(item -> { |
| | | UseRecordDTO useRecordDto = MapUtils.convertMapToObj(item, UseRecordDTO.class); |
| | | useRecordDTOList.add(useRecordDto); |
| | | }); |
| | | return useRecordDTOList; |
| | | } |
| | | } |