| | |
| | | } |
| | | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | |
| | | String supplierAndClinicId = null; |
| | | if (roleType == 4) { |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | supplierAndClinicId = crmSupplier.getId(); |
| | | } else { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | supplierAndClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | |
| | | List<TSysAppUser> sysAppUsers = sysAppUserService.list(Wrappers.lambdaQuery(TSysAppUser.class) |
| | | .eq(TSysAppUser::getClinicId, crmClinic.getId())); |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | List<TCrmClinicPoints> crmClinicPoints = crmClinicPointsService.clinicPointsStatistics(crmClinic.getId(), LocalDate.now() + " 23:59:59"); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | if (CollectionUtils.isEmpty(crmClinicPoints)) { |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询药品总类和总数 |
| | | Integer typeTotalCount = erpProcurementService.supplierSalesStatisticsTypeCount(crmSupplier.getId()); |
| | | Integer totalCount = erpProcurementService.supplierSalesStatisticsCount(crmSupplier.getId()); |
| | |
| | | break; |
| | | } |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | SupplierSalesStatisticsVO supplierSalesStatisticsVO = new SupplierSalesStatisticsVO(); |
| | | // 销售金额 |
| | | BigDecimal totalMoney = erpProcurementService.supplierSalesStatisticsMoney(crmSupplier.getId(), startTime, endTime); |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | // 查询药品总类和总数 |
| | | Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Arrays.asList(crmClinic.getId())); |
| | | Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Arrays.asList(crmClinic.getId())); |
| | | Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Collections.singletonList(crmClinic.getId())); |
| | | Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Collections.singletonList(crmClinic.getId())); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | map.put("typeTotalCount", typeTotalCount); |
| | | map.put("totalCount", totalCount); |
| | |
| | | break; |
| | | } |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | ClinicSalesStatisticsVO clinicSalesStatisticsVO = new ClinicSalesStatisticsVO(); |
| | | // 销售金额 |
| | | BigDecimal totalMoney = sysOrderService.clinicSalesStatisticsMoney(crmClinic.getId(), startTime, endTime); |
| | |
| | | Integer roleType = user.getRoleType(); |
| | | if (roleType == 2) { |
| | | TCrmBranch branch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, user.getUserId())); |
| | | .eq(TCrmBranch::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | if (branch != null) { |
| | | List<TCrmClinic> list = crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class).eq(TCrmClinic::getBranchId, branch.getId()).in(TCrmClinic::getStatus, Arrays.asList(3, 4, 5))); |
| | | if (!list.isEmpty()) { |
| | |
| | | crmBranchService.updateById(crmBranch); |
| | | // 查询用户 |
| | | SysUser sysUser = sysUserService.selectUserById(crmBranch.getUserId()); |
| | | // 查询业务员 |
| | | List<TCrmSalesperson> crmSalespersons = crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class) |
| | | .eq(TCrmSalesperson::getBranchId, id)); |
| | | switch (status){ |
| | | case 1: |
| | | // 解冻 |
| | | sysUser.setStatus("0"); |
| | | sysUserService.updateUser(sysUser); |
| | | if(!CollectionUtils.isEmpty(crmSalespersons)){ |
| | | List<Long> userIds = crmSalespersons.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList()); |
| | | sysUserService.updateUserStatusByUserIds(userIds, "0"); |
| | | } |
| | | break; |
| | | case 2: |
| | | // 冻结 |
| | | sysUser.setStatus("1"); |
| | | sysUserService.updateUser(sysUser); |
| | | // 查询业务员 |
| | | List<TCrmSalesperson> crmSalespersons = crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class) |
| | | .eq(TCrmSalesperson::getBranchId, id)); |
| | | if(!CollectionUtils.isEmpty(crmSalespersons)){ |
| | | List<Long> userIds = crmSalespersons.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList()); |
| | | sysUserService.updateUserStatusByUserIds(userIds, "1"); |
| | |
| | | private final TSysMessageTemplateService sysMessageTemplateService; |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TokenService tokenService; |
| | | private final TSysOtherConfigService sysOtherConfigService; |
| | | @Autowired |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService) { |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService, TSysOtherConfigService sysOtherConfigService) { |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.sysOrderService = sysOrderService; |
| | |
| | | this.sysMessageTemplateService = sysMessageTemplateService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.tokenService = tokenService; |
| | | this.sysOtherConfigService = sysOtherConfigService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping(value = "/medicationReminder") |
| | | public R<String> medicationReminder(@RequestParam(value = "userId") String userId, |
| | | @RequestParam(value = "templateId") String templateId) { |
| | | |
| | | Long clinicUserId = tokenService.getLoginUser().getUserId(); |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, clinicUserId) |
| | | .last("LIMIT 1")); |
| | | if(crmClinic == null){ |
| | | return R.fail("未找到该诊所信息"); |
| | | } |
| | | // 查询其他设置 |
| | | TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1); |
| | | if(crmClinic.getSendMessageCount()>=sysOtherConfig.getMsgCount()){ |
| | | return R.fail("该诊所今日发送短信次数已达上限"); |
| | | } |
| | | crmClinic.setSendMessageCount(crmClinic.getSendMessageCount() + 1); |
| | | crmClinicService.updateById(crmClinic); |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(userId); |
| | | if(StringUtils.isNotBlank(sysAppUser.getPhone())){ |
| | | sysAppUser.setLastReminderTime(LocalDateTime.now()); |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.SysUserUpdateStatusDTO; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | |
| | | private ISysDeptService deptService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TCrmSupplierService crmSupplierService; |
| | | @Autowired |
| | | private TCrmClinicService crmClinicService; |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | |
| | | public AjaxResult list(@RequestBody SysUserQuery query) |
| | | { |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | if(roleType == 1 || roleType == 4 || roleType == 5){ |
| | | query.setRoleType(roleType); |
| | | } |
| | | if(roleType == 4){ |
| | | // 查询供应商 |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | query.setObjectId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | | // 查询诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | query.setObjectId(crmClinic.getId()); |
| | | } |
| | | PageInfo<SysUserVO> list = userService.pageList(query); |
| | | return AjaxResult.success(list); |
| | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | if(roleType == 4){ |
| | | // 查询供应商 |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | user.setObjectId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | | // 查询诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | user.setObjectId(crmClinic.getId()); |
| | | } |
| | | user.setRoleType(roleType); |
| | | user.setUserName(user.getUserName()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void dayUpdateClinicMessageCount() { |
| | | try { |
| | | // 判断哪些诊所本月没有业绩达标 |
| | | List<TCrmClinic> clinics = crmClinicService.list(); |
| | | for (TCrmClinic clinic : clinics) { |
| | | clinic.setSendMessageCount(0); |
| | | } |
| | | crmClinicService.updateBatchById(clinics); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "微信openid") |
| | | @TableField("open_id") |
| | | private String openId; |
| | | @ApiModelProperty(value = "供应商-诊所使用,判断账号属于哪个供应商和诊所") |
| | | @TableField("object_id") |
| | | private String objectId; |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | |
| | | @TableField("performance_count") |
| | | private Integer performanceCount; |
| | | |
| | | @ApiModelProperty(value = "发送短信次数") |
| | | @TableField("send_message_count") |
| | | private Integer sendMessageCount; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "角色类型 1=平台 2=分公司 3=业务员 4=供应商 5=诊所端 6=仓库员 前端忽略") |
| | | private Integer roleType; |
| | | @ApiModelProperty(value = "前端忽略") |
| | | private String objectId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String typeName; |
| | | @ApiModelProperty(value = "商品数量") |
| | | private Integer goodsCount; |
| | | private Integer goodsCount=0; |
| | | |
| | | } |
| | |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, |
| | | u.districtId AS districtId,u.role_type as roleType, |
| | | u.districtId AS districtId,u.role_type as roleType,u.object_id as objectId, |
| | | ur.role_id AS roleId,sr.role_name AS roleName,u.deptName as deptName |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | <if test="query.roleType != null"> |
| | | AND u.role_type = #{query.roleType} |
| | | </if> |
| | | <if test="query.objectId != null and query.objectId != ''"> |
| | | AND u.object_id = #{query.objectId} |
| | | </if> |
| | | <if test="query.deptIds != null and query.deptIds.size()>0"> |
| | | AND u.user_id IN (select DISTINCT user_id from t_dept_to_user where dept_id IN |
| | | <foreach collection="query.deptIds" close=")" open="(" item="deptId" separator=","> |
| | |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="roleType != null">role_type,</if> |
| | | <if test="objectId != null">object_id,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="roleType != null">#{roleType},</if> |
| | | <if test="objectId != null">#{objectId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="audit_remark" property="auditRemark" /> |
| | | <result column="performance_count" property="performanceCount" /> |
| | | <result column="send_message_count" property="sendMessageCount" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, branch_id, salesperson_id, warehouse_id,user_id, clinic_name, person_charge_name, phone, low_procurement_money, |
| | | clinic_address, qualification_picture, status,audit_remark,performance_count, create_time, update_time, create_by, update_by, disabled |
| | | clinic_address, qualification_picture, status,audit_remark,performance_count,send_message_count, |
| | | create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmClinicVO"> |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled,tcc.performance_count,tcc.send_message_count, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.status in (3,4,5) |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.status in (3,4,5) |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.status in (3,4,5) |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.status in (3,4,5) |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.is_platform_commission = 1 |
| | | AND tep.status in (3,4,5) |
| | |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.is_platform_commission = 1 |
| | | AND tep.status in (3,4,5) |
| | |
| | | and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach> |
| | | </select> |
| | | <select id="clinicSalesStatisticsTypeCount" resultType="java.lang.Integer"> |
| | | select count(1) |
| | | select count(DISTINCT teg.type_id) |
| | | from t_sys_order tso |
| | | left join t_sys_order_goods tsog on tso.id = tsog.order_id |
| | | left join t_erp_goods teg on tsog.goods_id = teg.id |
| | | where tso.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | and tso.clinic_id in <foreach collection="clinicIds" open="(" separator="," item="id" close=")">#{id}</foreach> |
| | | group by teg.type_id |
| | | </select> |
| | | <select id="clinicSalesStatisticsMoney" resultType="java.math.BigDecimal"> |
| | | select sum(total_money) from t_sys_order |