40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
|
|
package com.gunshi.project.hsz.mapper;
|
||
|
|
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||
|
|
import com.gunshi.project.hsz.entity.so.ByPlanPageSo;
|
||
|
|
import com.gunshi.project.hsz.model.ByPlanDetail;
|
||
|
|
import jakarta.validation.constraints.NotNull;
|
||
|
|
import org.apache.ibatis.annotations.Mapper;
|
||
|
|
import org.apache.ibatis.annotations.Param;
|
||
|
|
import org.apache.ibatis.annotations.Select;
|
||
|
|
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Mapper
|
||
|
|
public interface ByPlanDetailMapper extends BaseMapper<ByPlanDetail> {
|
||
|
|
@Select("""
|
||
|
|
<script>
|
||
|
|
select t1.id,t1.plan_id,t1.pre_place_detail_id as ppdi,t1.pre_method,
|
||
|
|
t2.detail_name as ppdn,t3.id as ppi,t3.pre_name as ppn from
|
||
|
|
by_plan_detail t1
|
||
|
|
join pre_place_detail t2 on t1.pre_place_detail_id = t2.id and t2.is_enable = 0
|
||
|
|
join pre_place t3 on t2.pre_id = t3.id
|
||
|
|
where 1=1 and t1.plan_id = #{planId}
|
||
|
|
<if test= "dto.dto.preDetailName !=null and dto.dto.preDetailName !=''">
|
||
|
|
and t2.detail_name LIKE '%'|| #{dto.preDetailName}||'%'
|
||
|
|
</if>
|
||
|
|
</script>
|
||
|
|
""")
|
||
|
|
List<ByPlanDetail> selectList(@Param("planId")String planId, @Param("dto") ByPlanPageSo dto);
|
||
|
|
|
||
|
|
|
||
|
|
@Select("""
|
||
|
|
select count(*)
|
||
|
|
from by_plan_detail t
|
||
|
|
where t.pre_place_detail_id = #{id}
|
||
|
|
""")
|
||
|
|
int selectByPPDI(@Param("id") Serializable id);
|
||
|
|
}
|