Commit a6fc77c2 by 翁国栋 Committed by 284718418@qq.com

8小时运营后台操作

parent 629c15f8
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
......@@ -10,13 +11,10 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
......@@ -88,7 +86,17 @@ public class InsureLog extends Model<InsureLog> {
private Integer policyId;
public String fileUrl;
private Integer userType;
private String userName;
private String companyName;
private Integer requestResults;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "组管理员id")
private String policyNo;
/**
* 设置:
......
......@@ -19,6 +19,7 @@ import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.insure.InsureLogMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.dto.insure.LogDto;
import cn.timer.api.dto.insure.PolicyLogDto;
import cn.timer.api.utils.Page;
import cn.timer.api.utils.Result;
......@@ -118,5 +119,13 @@ public class InsureLogController {
return ResultUtil.data(map);
}
@PostMapping(value = "/actionLogList")
@ApiOperation(value = "操作列表--运营后台", httpMethod = "GET", notes = "日志列表")
public Result<Object> actionLogList(@RequestBody LogDto logDto) {
Map map = Maps.newHashMap();
List<InsureLog> list=insureLogMapper.logList(logDto);
map.put("list", list);
map.put("totalNum",insureLogMapper.logListTotal(logDto));
return ResultUtil.data(map);
}
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureLog;
import cn.timer.api.dto.insure.LogDto;
import cn.timer.api.dto.insure.PolicyLogDto;
import cn.timer.api.utils.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -8,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
*
......@@ -23,5 +25,7 @@ public interface InsureLogMapper extends BaseMapper<InsureLog> {
List<InsureLog> selectListByIds(@Param("array")Integer[] ids);
List<PolicyLogDto> selectLogListByOrgCode(@Param("orgCode") Integer orgCode, @Param("page") Page page);
Integer selectLogTotalByOrgCode(@Param("orgCode") Integer orgCode);
List<InsureLog> logList(@Param("param") LogDto logDto);
List<Map<String,String>> logListTotal(@Param("param") LogDto logDto);
}
package cn.timer.api.dto.insure;
import cn.timer.api.utils.Page;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/10/14 19:28
*/
@Data
public class LogDto {
private String policyNo;
private Page page;
private Integer type;
}
......@@ -19,6 +19,12 @@
<result property="requestType" column="request_type"/>
<result property="policyId" column="policy_id"/>
<result property="fileUrl" column="file_url"/>
<result property="userType" column="user_type"/>
<result property="userName" column="user_name"/>
<result property="companyName" column="company_name"/>
<result property="requestResults" column="request_results"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureLog">
......@@ -172,7 +178,8 @@
</delete>
<select id="selectListById" resultType="cn.timer.api.bean.insure.InsureLog">
select id,return_msg,`type`,create_time,file_url from insure_log
select id, return_msg, `type`, create_time, file_url
from insure_log
where policy_id = #{policyId}
ORDER BY create_time DESC
</select>
......@@ -185,18 +192,64 @@
</foreach>
</select>
<select id="selectLogListByOrgCode" resultType="cn.timer.api.dto.insure.PolicyLogDto">
select ip.policy_no as policyNo,il.return_code as returnCode,il.return_msg as returnMsg,il.type as type,il.create_time as createTime from insure_log il
LEFT JOIN insure_policy ip on ip.id=il.policy_id
WHERE ip.org_code = #{orgCode}
order by il.create_time desc
select ip.policy_no as policyNo,il.return_code as returnCode,il.return_msg as returnMsg,il.type as
type,il.create_time as createTime from insure_log il
LEFT JOIN insure_policy ip on ip.id=il.policy_id
WHERE ip.org_code = #{orgCode}
order by il.create_time desc
<if test="page.currentPage != null and page.totalPage != null">
limit #{page.offset}, #{page.totalPage}
</if>
</select>
<select id="selectLogTotalByOrgCode" resultType="java.lang.Integer">
select count(il.id) from insure_log il
LEFT JOIN insure_policy ip on ip.id=il.policy_id
select count(il.id)
from insure_log il
LEFT JOIN insure_policy ip on ip.id = il.policy_id
WHERE ip.org_code = #{orgCode}
</select>
<select id="logList" resultType="cn.timer.api.bean.insure.InsureLog">
select log.id,
ip.policy_no,
log.user_name,
log.policy_id,
q.`name` as companyName,
log.create_time,
log.return_code,
log.file_url,
log.type
from insure_log log
LEFT JOIN insure_policy ip on ip.id = log.policy_id
LEFT JOIN qyzx_ent_info_m q on q.id = ip.org_code
WHERE log.type in (1,2,3,7,8)
<if test="param.policyNo!=null and param.policyNo != ''">
and ip.policy_no = #{param.policyNo}
</if>
<if test="param.type==1">
and log.return_code in ('1','suc')
</if>
<if test="param.type==0">
and log.return_code in ('0','e1')
</if>
order by log.create_time desc
<if test="param.page.currentPage != null and param.page.totalPage != null">
limit #{param.page.offset}, #{param.page.totalPage}
</if>
</select>
<select id="logListTotal" resultType="java.util.HashMap">
select count(log.id) as totalNum,count(CASE WHEN return_code = '1' OR return_code='suc' THEN 1 END) as sucNum,count(CASE WHEN return_code = '0' OR return_code='e1' THEN 1 END) as errNum
from insure_log log
LEFT JOIN insure_policy ip on ip.id = log.policy_id
WHERE log.type in (1,2,3,7,8)
<if test="param.policyNo!=null and param.policyNo != ''">
and ip.policy_no = #{param.policyNo}
</if>
<if test="param.type==1">
and log.return_code in ('1','suc')
</if>
<if test="param.type==0">
and log.return_code in ('0','e1')
</if>
</select>
</mapper>
......@@ -442,7 +442,7 @@
FROM insure_user iu
left join insure_product_plan ipp on ipp.id=iu.product_plan_id
WHERE policy_id = #{policyId}
group by product_plan_id
group by benefit_occupation_category
</select>
<update id="updateInsure">
......
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