81,092
社区成员
发帖
与我相关
我的任务
分享
public PageInfo<MourningRecord> getMourningRecordPageInfo(Map<String, Object> paramMap,int pageNum,int pageSize,String order){
PageHelper.startPage(pageNum, pageSize);//设置分页
PageHelper.orderBy(order);
List<MourningRecord> list=mourningRecordMapper.getMourningRecordListMap(paramMap);
PageInfo<MourningRecord> page=new PageInfo<MourningRecord>(list);
return page;
}
<select id= "getMourningRecordListMap" resultMap="MourningRecordListMapper">
select c.`name`,c.`schedule_flag`,c.`cremation_time`,c.`age`,c.`sex`,b.`name` as bname,m.`begin_time` from y_mourning_record m,y_commission_order c,ba_mourning b where m.commission_order_id = c.id and m.mourning_id=b.id
<if test="flag!=null and flag!=''">
and m.flag=#{flag}
</if>
<if test="beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
and ( ( m.begin_time >= #{beginDate} and m.begin_time <= #{endDate} )
or ( m.end_time >= #{beginDate} and m.end_time <= #{endDate} )
or ( m.begin_time <= #{beginDate} and m.end_time >= #{endDate} ))
</if>
<if test="mourningbeginDate !=null and mourningbeginDate != '' and mourningendDate !=null and mourningendDate != '' ">
and ( m.begin_time >=#{mourningbeginDate} )
and ( m.begin_time <= #{mourningendDate} )
</if>
<if test="searchType !=null and searchType != '' and searchType=='1'.toString() ">
and c.name like CONCAT('%', #{searchVal},'%')
</if>
<if test="searchType !=null and searchType != '' and searchType=='2'.toString() ">
and b.name like CONCAT('%', #{searchVal},'%')
</if>
</select>
<resultMap id="MourningRecordListMapper" type="MourningRecord">
<id property="id" column="id" />
<result property="mourningId" column="mourning_id" />
<result property="beginTime" column="begin_time" />
<result property="createUserId" column="create_user_id" /> -->
<result property="commissionOrderId" column="commission_order_id" />
<result property="flag" column="flag" />
<association property="order" javaType="CommissionOrder">
<id property="id" column="id"/>
<result property="name" column="name" />
<result property="cardCode" column="card_code" />
<result property="sex" column="sex" />
<result property="cremationTime" column="cremation_time" />
<result property="age" column="age" />
<result property="scheduleFlag" column="schedule_flag" />
</association>
<association property="mourning" javaType="Mourning">
<id property="id" column="id" />
<result property="name" column="bname" />
</association>
</resultMap>