Commit 11c71aa3 by huangZW

111

parent 0805b20c
...@@ -22,6 +22,9 @@ public interface TabHaobanAuditMapper { ...@@ -22,6 +22,9 @@ public interface TabHaobanAuditMapper {
Page<TabHaobanAudit> page(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag ); Page<TabHaobanAudit> page(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
Page<TabHaobanAudit> pageForStoreIdsAndstaffIds(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
List<TabHaobanAudit> listByStoreId(String storeId); List<TabHaobanAudit> listByStoreId(String storeId);
TabHaobanAudit findByStoreIdAndChangeField(@Param("storeId")String storeId,@Param("changeField")String changeField); TabHaobanAudit findByStoreIdAndChangeField(@Param("storeId")String storeId,@Param("changeField")String changeField);
......
...@@ -70,7 +70,12 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -70,7 +70,12 @@ public class AuditApiServiceImpl implements AuditApiService{
} }
} }
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag); com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
if(CollectionUtil.isNotEmpty(storeIds)&&CollectionUtil.isNotEmpty(staffIds)){
page = auditMapper.pageForStoreIdsAndstaffIds(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag);
}else{
page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag);
}
// List<TabHaobanAudit> list = page.getResult(); // List<TabHaobanAudit> list = page.getResult();
if(CollectionUtil.isNotEmpty( page.getResult())){ if(CollectionUtil.isNotEmpty( page.getResult())){
List<String> commitStaffIds = page.getResult().stream().map(s->s.getCommitStaffId()).collect(Collectors.toList()); List<String> commitStaffIds = page.getResult().stream().map(s->s.getCommitStaffId()).collect(Collectors.toList());
......
...@@ -300,6 +300,45 @@ ...@@ -300,6 +300,45 @@
order by commit_time desc order by commit_time desc
</select> </select>
<select id="pageForStoreIdsAndstaffIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
<if test = "wxEnterpriseId != null">
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
<if test = "enterpriseId != null and enterpriseId !=''">
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
<if test = "auditType != null">
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if test = "auditFlag != null and auditFlag == 0">
and audit_status = 0
</if>
<if test = "auditFlag != null and auditFlag != 0">
and audit_status in (1,2)
</if>
<if test = "auditStatus != null">
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
and ( commit_store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or commit_staff_id in
<foreach collection="staffIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
<include refid="storeSql"/>
<include refid="staffSql"/>
order by commit_time desc
</select>
<select id="listByStoreId" resultMap="BaseResultMap" > <select id="listByStoreId" resultMap="BaseResultMap" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment