ScrmBatchMomentStaffMapper.xml 3.2 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.entmicro.mapper.ScrmBatchMomentStaffMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.wechatcloudcontrol.batchmoment.ScrmBatchMomentStaff">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="request_key" jdbcType="VARCHAR" property="requestKey"/>
    <result column="scrm_batch_moment_id" jdbcType="INTEGER" property="scrmBatchMomentId" />
    <result column="moment_id" jdbcType="VARCHAR" property="momentId" />
    <result column="staff_id" jdbcType="INTEGER" property="staffId" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="err_msg" jdbcType="VARCHAR" property="errMsg" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
    <result column="created_by" jdbcType="INTEGER" property="createdBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_by" jdbcType="INTEGER" property="updatedBy" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
  </resultMap>

  <resultMap id="BaseResultMap1" type="cn.com.glsx.entmicro.model.response.wechatcloudcontrol.batchmoment.BatchMomentStaffRecordRpcResponse">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="request_key" jdbcType="VARCHAR" property="requestKey"/>
    <result column="staff_id" jdbcType="INTEGER" property="staffId" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
    <result column="created_by" jdbcType="INTEGER" property="createdBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_by" jdbcType="INTEGER" property="updatedBy" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, request_key, scrm_batch_moment_id, moment_id, staff_id, user_id, `status`, send_time, remark, err_msg,
    del_flag, created_by, created_time, updated_by, updated_time
  </sql>
  <select id="getStaffStatusCount"
          resultType="cn.com.glsx.entmicro.model.wechatcloudcontrol.BatchMomentStaffCount">
    SELECT scrm_batch_moment_id AS id ,`status`,COUNT(1) AS `count`
    FROM `scrm_batch_moment_staff`
    WHERE scrm_batch_moment_id IN
     <foreach collection="scrmBatchMomentIds" separator="," open="(" close=")" item="id">
       #{id}
     </foreach>
    AND del_flag=0
     GROUP BY scrm_batch_moment_id,STATUS;
  </select>
  <select id="batchMomentStaffRecordPage" resultMap="BaseResultMap1">
      SELECT <include refid="Base_Column_List"/> FROM `scrm_batch_moment_staff`
      WHERE scrm_batch_moment_id = #{condition.id} AND del_flag=0 order by send_time desc
  </select>
</mapper>