1.修改员工更新主播邀约状态Sql 逻辑
This commit is contained in:
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsPageReqVO;
|
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsPageReqVO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
||||||
@@ -30,4 +31,6 @@ public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
|||||||
IPage<EmployeeHostsDO> selectPageWithXML(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
IPage<EmployeeHostsDO> selectPageWithXML(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
||||||
|
|
||||||
void batchUpdate(ArrayList<EmployeeHostsDO> employeeHostsDOS);
|
void batchUpdate(ArrayList<EmployeeHostsDO> employeeHostsDOS);
|
||||||
|
|
||||||
|
void updateByXml(@Param("employeeHostsDO") EmployeeHostsDO employeeHostsDO,@Param("tenantId") Long tenantId);
|
||||||
}
|
}
|
||||||
@@ -60,15 +60,8 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
validateEmployeeHostsExists(updateReqVO.getId());
|
validateEmployeeHostsExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
Long tenantId = TenantContextHolder.getTenantId();
|
Long tenantId = TenantContextHolder.getTenantId();
|
||||||
EmployeeHostsDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeHostsDO.class);
|
EmployeeHostsDO employeeHostsDO = BeanUtils.toBean(updateReqVO, EmployeeHostsDO.class);
|
||||||
LambdaUpdateWrapper<EmployeeHostsDO> updateWrapper = new LambdaUpdateWrapper<>();
|
employeeHostsMapper.updateByXml(employeeHostsDO,tenantId);
|
||||||
updateWrapper.set(EmployeeHostsDO::getOperationStatus, updateReqVO.getOperationStatus());
|
|
||||||
updateWrapper.eq(EmployeeHostsDO::getUserId, updateReqVO.getUserId());
|
|
||||||
updateWrapper.eq(EmployeeHostsDO::getHostsId,updateObj.getHostsId());
|
|
||||||
updateWrapper.eq(EmployeeHostsDO::getTenantId, tenantId);
|
|
||||||
employeeHostsMapper.update(updateObj, updateWrapper);
|
|
||||||
|
|
||||||
// employeeHostsMapper.updateById(updateObj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -314,4 +314,14 @@
|
|||||||
seh.id = #{item.id}
|
seh.id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByXml">
|
||||||
|
UPDATE server_employee_hosts as seh
|
||||||
|
SET
|
||||||
|
operation_status = #{employeeHostsDO.operationStatus,jdbcType=INTEGER}
|
||||||
|
WHERE
|
||||||
|
seh.user_id = #{employeeHostsDO.userId,jdbcType=BIGINT}
|
||||||
|
and seh.hosts_id=#{employeeHostsDO.hostsId,jdbcType=VARCHAR}
|
||||||
|
and tenant_id =#{tenantId,jdbcType=BIGINT}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user