diff --git a/src/main/java/com/sztzjy/marketing/controller/stu/QianFanBigModuleController.java b/src/main/java/com/sztzjy/marketing/controller/stu/QianFanBigModuleController.java index d7ea0be..e23055c 100644 --- a/src/main/java/com/sztzjy/marketing/controller/stu/QianFanBigModuleController.java +++ b/src/main/java/com/sztzjy/marketing/controller/stu/QianFanBigModuleController.java @@ -5,7 +5,6 @@ import com.sztzjy.marketing.entity.StuUploadImgAi; import com.sztzjy.marketing.entity.StuUploadImgAiExample; import com.sztzjy.marketing.entity.dto.StuCreateArticleDTO; import com.sztzjy.marketing.entity.dto.StuCreateImgDTO; -import com.sztzjy.marketing.entity.dto.StuUploadAiDTO; import com.sztzjy.marketing.mapper.StuUploadImgAiMapper; import com.sztzjy.marketing.qianfan.Qianfan; import com.sztzjy.marketing.qianfan.model.chat.Message; @@ -24,6 +23,7 @@ import org.springframework.http.HttpStatus; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.yaml.snakeyaml.reader.StreamReader; @@ -91,11 +91,12 @@ public class QianFanBigModuleController { @PostMapping("/uploadFile") @AnonymousAccess @Transactional(rollbackFor = Exception.class) - public ResultEntity uploadFile(@RequestBody StuUploadAiDTO stuUploadAiDTO) { + public ResultEntity uploadFile(@RequestPart MultipartFile file, + String userId,String module,Integer count,String schoolId) { //获取后缀 - String originalFilename = stuUploadAiDTO.getFile().getOriginalFilename(); + String originalFilename =file.getOriginalFilename(); String substring = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); @@ -125,14 +126,14 @@ public class QianFanBigModuleController { if (!list.contains(substring)) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请上传格式的文件"); } - String upload = iFileUtil.upload(stuUploadAiDTO.getFile()); + String upload = iFileUtil.upload(file); //判断是第几次上传是哪个模块的,老师是否评分 StuUploadImgAiExample example = new StuUploadImgAiExample(); example.createCriteria(). - andUserIdEqualTo(stuUploadAiDTO.getUserId()). - andModuleEqualTo(stuUploadAiDTO.getModule()) - .andUploadNumberEqualTo(stuUploadAiDTO.getCount()); + andUserIdEqualTo(userId). + andModuleEqualTo(module) + .andUploadNumberEqualTo(count); List<StuUploadImgAi> stuUploadImgAiList = stuUploadImgAiMapper.selectByExampleWithBLOBs(example); if (CollectionUtils.isEmpty(stuUploadImgAiList)){ @@ -140,12 +141,13 @@ public class QianFanBigModuleController { stuUploadImgAi.setFilePath(upload); stuUploadImgAi.setCreateTime(new Date()); - stuUploadImgAi.setUserId(stuUploadAiDTO.getUserId()); - stuUploadImgAi.setModule(stuUploadAiDTO.getModule()); - stuUploadImgAi.setUploadNumber(stuUploadAiDTO.getCount()); - stuUploadImgAi.setFileSize((double) stuUploadAiDTO.getFile().getSize()); - stuUploadImgAi.setFileName(stuUploadAiDTO.getFile().getOriginalFilename()); + stuUploadImgAi.setUserId(userId); + stuUploadImgAi.setModule(module); + stuUploadImgAi.setUploadNumber(count); + stuUploadImgAi.setFileSize((double) file.getSize()); + stuUploadImgAi.setFileName(file.getOriginalFilename()); stuUploadImgAi.setSufxx(substring); + stuUploadImgAi.setSchoolId(schoolId); stuUploadImgAiMapper.insertSelective(stuUploadImgAi); @@ -161,10 +163,10 @@ public class QianFanBigModuleController { stuUploadImgAi.setFilePath(upload); stuUploadImgAi.setUpdateTime(new Date()); - stuUploadImgAi.setFileSize((double) stuUploadAiDTO.getFile().getSize()); - stuUploadImgAi.setFileName(stuUploadAiDTO.getFile().getOriginalFilename()); + stuUploadImgAi.setFileSize((double) file.getSize()); + stuUploadImgAi.setFileName(file.getOriginalFilename()); stuUploadImgAi.setSufxx(substring); - stuUploadImgAiMapper.updateByPrimaryKeyWithBLOBs(stuUploadImgAi); + stuUploadImgAiMapper.updateByPrimaryKeySelective(stuUploadImgAi); } diff --git a/src/main/java/com/sztzjy/marketing/controller/tch/SummaryOfGradesController.java b/src/main/java/com/sztzjy/marketing/controller/tch/SummaryOfGradesController.java index 9142752..064d880 100644 --- a/src/main/java/com/sztzjy/marketing/controller/tch/SummaryOfGradesController.java +++ b/src/main/java/com/sztzjy/marketing/controller/tch/SummaryOfGradesController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; import com.sztzjy.marketing.annotation.AnonymousAccess; import com.sztzjy.marketing.entity.TchModuleWeith; import com.sztzjy.marketing.entity.TchModuleWeithExample; +import com.sztzjy.marketing.entity.dto.StuUserDto; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewInfoDTO; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO; import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO; @@ -14,6 +15,7 @@ import com.sztzjy.marketing.util.ResultEntity; import com.sztzjy.marketing.util.excel.FilePortUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -101,6 +103,34 @@ public class SummaryOfGradesController { + //实验报告 + @ApiOperation("实验报告展示") + @GetMapping("/reportPresentation") + @AnonymousAccess + public ResultEntity reportPresentation(Integer page,Integer size,String schoolId) { + return userService.reportPresentation(page,size,schoolId); + } + + @GetMapping("/getCurrencyScoreReport") + @ApiOperation("评阅界面") + @AnonymousAccess + public ResultEntity<PageInfo<StuUserDto>> getCurrencyScoreReport(@RequestParam String schoolId, + @RequestParam Integer index, + @RequestParam Integer size, + @ApiParam("模块名") @RequestParam(required = false) String module, + @RequestParam(required = false) String name, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String className, + @RequestParam(required = false) String keyWord) { + return new ResultEntity<>(userService.getCurrencyScoreReport(schoolId, index, size, module, name, studentId, className,keyWord)); + } + + @AnonymousAccess + @GetMapping("/getClassNameBySchoolId") + @ApiOperation("班级下拉框") + public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) { + return new ResultEntity<List<String>>(userService.getClassNameBySchoolId(schoolId)); + } diff --git a/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAi.java b/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAi.java index e7fb0b2..b901954 100644 --- a/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAi.java +++ b/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAi.java @@ -42,8 +42,8 @@ public class StuUploadImgAi { @ApiModelProperty("文件后缀") private String sufxx; - @ApiModelProperty("暂时不用") - private String append; + @ApiModelProperty("学校ID") + private String schoolId; @ApiModelProperty("老师评语") private String tchComment; @@ -136,12 +136,12 @@ public class StuUploadImgAi { this.sufxx = sufxx == null ? null : sufxx.trim(); } - public String getAppend() { - return append; + public String getSchoolId() { + return schoolId; } - public void setAppend(String append) { - this.append = append == null ? null : append.trim(); + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); } public String getTchComment() { diff --git a/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAiExample.java b/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAiExample.java index 77d017b..34d9e14 100644 --- a/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAiExample.java +++ b/src/main/java/com/sztzjy/marketing/entity/StuUploadImgAiExample.java @@ -815,73 +815,73 @@ public class StuUploadImgAiExample { return (Criteria) this; } - public Criteria andAppendIsNull() { - addCriterion("append is null"); + public Criteria andSchoolIdIsNull() { + addCriterion("school_id is null"); return (Criteria) this; } - public Criteria andAppendIsNotNull() { - addCriterion("append is not null"); + public Criteria andSchoolIdIsNotNull() { + addCriterion("school_id is not null"); return (Criteria) this; } - public Criteria andAppendEqualTo(String value) { - addCriterion("append =", value, "append"); + public Criteria andSchoolIdEqualTo(String value) { + addCriterion("school_id =", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendNotEqualTo(String value) { - addCriterion("append <>", value, "append"); + public Criteria andSchoolIdNotEqualTo(String value) { + addCriterion("school_id <>", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendGreaterThan(String value) { - addCriterion("append >", value, "append"); + public Criteria andSchoolIdGreaterThan(String value) { + addCriterion("school_id >", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendGreaterThanOrEqualTo(String value) { - addCriterion("append >=", value, "append"); + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { + addCriterion("school_id >=", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendLessThan(String value) { - addCriterion("append <", value, "append"); + public Criteria andSchoolIdLessThan(String value) { + addCriterion("school_id <", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendLessThanOrEqualTo(String value) { - addCriterion("append <=", value, "append"); + public Criteria andSchoolIdLessThanOrEqualTo(String value) { + addCriterion("school_id <=", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendLike(String value) { - addCriterion("append like", value, "append"); + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendNotLike(String value) { - addCriterion("append not like", value, "append"); + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); return (Criteria) this; } - public Criteria andAppendIn(List<String> values) { - addCriterion("append in", values, "append"); + public Criteria andSchoolIdIn(List<String> values) { + addCriterion("school_id in", values, "schoolId"); return (Criteria) this; } - public Criteria andAppendNotIn(List<String> values) { - addCriterion("append not in", values, "append"); + public Criteria andSchoolIdNotIn(List<String> values) { + addCriterion("school_id not in", values, "schoolId"); return (Criteria) this; } - public Criteria andAppendBetween(String value1, String value2) { - addCriterion("append between", value1, value2, "append"); + public Criteria andSchoolIdBetween(String value1, String value2) { + addCriterion("school_id between", value1, value2, "schoolId"); return (Criteria) this; } - public Criteria andAppendNotBetween(String value1, String value2) { - addCriterion("append not between", value1, value2, "append"); + public Criteria andSchoolIdNotBetween(String value1, String value2) { + addCriterion("school_id not between", value1, value2, "schoolId"); return (Criteria) this; } } diff --git a/src/main/java/com/sztzjy/marketing/entity/dto/StuUploadAiDTO.java b/src/main/java/com/sztzjy/marketing/entity/dto/StuUploadAiDTO.java deleted file mode 100644 index e115cfa..0000000 --- a/src/main/java/com/sztzjy/marketing/entity/dto/StuUploadAiDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sztzjy.marketing.entity.dto; - -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.springframework.web.multipart.MultipartFile; - -import java.util.List; - -/** - * @author 17803 - * @date 2024-08-20 10:06 - */ -@Data -public class StuUploadAiDTO { - - - private MultipartFile file; - private String userId; - private String module; - @ApiModelProperty("上传模块的第几个文件(1,2,3))") - private Integer count; - -} diff --git a/src/main/java/com/sztzjy/marketing/entity/dto/StuUserDto.java b/src/main/java/com/sztzjy/marketing/entity/dto/StuUserDto.java new file mode 100644 index 0000000..464a680 --- /dev/null +++ b/src/main/java/com/sztzjy/marketing/entity/dto/StuUserDto.java @@ -0,0 +1,28 @@ +package com.sztzjy.marketing.entity.dto; + +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +public class StuUserDto { + private String userId; + + private String name; + + private String studentId; + + private String module; + + private String className; + +// private String schoolId; + + private String reportUrl; + + private Integer reportId; + + private Double rating; + +// private Integer reportStatus; +} diff --git a/src/main/java/com/sztzjy/marketing/entity/dto/TchrePortPresentationDTO.java b/src/main/java/com/sztzjy/marketing/entity/dto/TchrePortPresentationDTO.java new file mode 100644 index 0000000..9dbcdfd --- /dev/null +++ b/src/main/java/com/sztzjy/marketing/entity/dto/TchrePortPresentationDTO.java @@ -0,0 +1,28 @@ +package com.sztzjy.marketing.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author 17803 + * @date 2024-08-20 13:36 + */ +@Data +public class TchrePortPresentationDTO { + + private String name; + private String studentId; + private String className; + private String module; + @ApiModelProperty("文件名") + private String fileName; + + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("文件大小") + private Double fileSize; +} diff --git a/src/main/java/com/sztzjy/marketing/mapper/StuUploadImgAiMapper.java b/src/main/java/com/sztzjy/marketing/mapper/StuUploadImgAiMapper.java index 7aaa718..0e18130 100644 --- a/src/main/java/com/sztzjy/marketing/mapper/StuUploadImgAiMapper.java +++ b/src/main/java/com/sztzjy/marketing/mapper/StuUploadImgAiMapper.java @@ -3,7 +3,10 @@ package com.sztzjy.marketing.mapper; import com.sztzjy.marketing.entity.StuUploadImgAi; import com.sztzjy.marketing.entity.StuUploadImgAiExample; import java.util.List; + +import com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; public interface StuUploadImgAiMapper { long countByExample(StuUploadImgAiExample example); @@ -33,4 +36,18 @@ public interface StuUploadImgAiMapper { int updateByPrimaryKeyWithBLOBs(StuUploadImgAi record); int updateByPrimaryKey(StuUploadImgAi record); + + + @Select(" select s.name as name , s.student_id as studentId, s.class_name as className,\n" + + " i.module as module ,i.file_name as fileName ,i.create_time as createTime ,i.file_size as fileSize\n" + + " from stu_upload_img_ai i\n" + + " join\n" + + " stu_user s\n" + + " on\n" + + " i.user_id = s.user_id\n" + + " where\n" + + " s.school_id = #{schoolId}\n" + + " order by\n" + + " i.create_time asc") + List<TchrePortPresentationDTO> selectInfoBySchoolId(String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/marketing/mapper/StuUserMapper.java b/src/main/java/com/sztzjy/marketing/mapper/StuUserMapper.java index ad3e394..5406afc 100644 --- a/src/main/java/com/sztzjy/marketing/mapper/StuUserMapper.java +++ b/src/main/java/com/sztzjy/marketing/mapper/StuUserMapper.java @@ -3,6 +3,8 @@ package com.sztzjy.marketing.mapper; import com.sztzjy.marketing.entity.StuUser; import com.sztzjy.marketing.entity.StuUserExample; import java.util.List; + +import com.sztzjy.marketing.entity.dto.StuUserDto; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -31,4 +33,8 @@ public interface StuUserMapper { @Select("select school_id from stu_user group by school_id") List<String> selectSchool(); + + List<StuUserDto> selectByCondition(String name, String studentId, String className, String module, String keyWord, String schoolId); + + List<String> getClassNameBySchoolId(String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/marketing/service/TchUserService.java b/src/main/java/com/sztzjy/marketing/service/TchUserService.java index 8403356..09f48eb 100644 --- a/src/main/java/com/sztzjy/marketing/service/TchUserService.java +++ b/src/main/java/com/sztzjy/marketing/service/TchUserService.java @@ -1,9 +1,11 @@ package com.sztzjy.marketing.service; import com.github.pagehelper.PageInfo; +import com.sztzjy.marketing.entity.dto.StuUserDto; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewInfoDTO; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO; import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO; +import com.sztzjy.marketing.util.ResultEntity; import java.util.List; @@ -20,4 +22,16 @@ public interface TchUserService { Boolean insertByTchGeneralViewWeightDTO(TchGeneralViewWeightDTO generalViewWeightDTO); void totalRank(String schoolId); + + /** + * 实验报告展示 + * @param schoolId + * @return + */ + + ResultEntity reportPresentation(Integer page,Integer size,String schoolId); + + PageInfo<StuUserDto> getCurrencyScoreReport(String schoolId, Integer index, Integer size, String module, String name, String studentId, String className, String keyWord); + + List<String> getClassNameBySchoolId(String schoolId); } diff --git a/src/main/java/com/sztzjy/marketing/service/impl/TchUserServiceImpl.java b/src/main/java/com/sztzjy/marketing/service/impl/TchUserServiceImpl.java index 31740b8..37df59c 100644 --- a/src/main/java/com/sztzjy/marketing/service/impl/TchUserServiceImpl.java +++ b/src/main/java/com/sztzjy/marketing/service/impl/TchUserServiceImpl.java @@ -7,21 +7,25 @@ import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.marketing.config.ThreadPoolConfig; -import com.sztzjy.marketing.entity.StuUser; -import com.sztzjy.marketing.entity.StuUserExample; -import com.sztzjy.marketing.entity.TchModuleWeith; -import com.sztzjy.marketing.entity.TchModuleWeithExample; +import com.sztzjy.marketing.entity.*; +import com.sztzjy.marketing.entity.dto.StuUserDto; +import com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewInfoDTO; import com.sztzjy.marketing.entity.tchdto.TchGeneralViewWeightDTO; import com.sztzjy.marketing.entity.tchdto.tchScoreViewShowDTO; +import com.sztzjy.marketing.mapper.StuUploadImgAiMapper; import com.sztzjy.marketing.mapper.StuUserMapper; import com.sztzjy.marketing.mapper.TchModuleWeithMapper; import com.sztzjy.marketing.service.TchUserService; +import com.sztzjy.marketing.util.PageUtil; +import com.sztzjy.marketing.util.ResultEntity; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.HttpStatus; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -43,6 +47,8 @@ public class TchUserServiceImpl implements TchUserService { ThreadPoolConfig threadPoolConfig; + @Autowired + private StuUploadImgAiMapper stuUploadImgAiMapper; // 成绩总览展示 (条件查询) @Override @@ -138,6 +144,31 @@ public class TchUserServiceImpl implements TchUserService { } + /** + * 实验报告展示 + * @param schoolId + * @return + */ + + @Override + public ResultEntity reportPresentation(Integer page,Integer size,String schoolId) { + + PageHelper.startPage(page,size); + + List<TchrePortPresentationDTO> tchrePortPresentationDTOList + = stuUploadImgAiMapper.selectInfoBySchoolId(schoolId); + + PageInfo<TchrePortPresentationDTO> tchrePortPresentationDTOPageInfo = new PageInfo<>(tchrePortPresentationDTOList); + + return new ResultEntity<>(HttpStatus.OK,tchrePortPresentationDTOPageInfo); + + } + @Override + public PageInfo<StuUserDto> getCurrencyScoreReport(String schoolId, Integer index, Integer size, String module, String name, String studentId, String className, String keyWord) { + List<StuUserDto> userDtoList= stuUserMapper.selectByCondition(name,studentId,className,module,keyWord,schoolId); + PageInfo<StuUserDto> pageInfo = PageUtil.pageHelper(userDtoList, index, size); + return pageInfo; + } public TchModuleWeith selectBySchoolId(String schoolId) { TchModuleWeithExample example=new TchModuleWeithExample(); @@ -157,4 +188,9 @@ public class TchUserServiceImpl implements TchUserService { } } + + @Override + public List<String> getClassNameBySchoolId(String schoolId) { + return stuUserMapper.getClassNameBySchoolId(schoolId); + } } diff --git a/src/main/resources/mappers/StuUploadImgAiMapper.xml b/src/main/resources/mappers/StuUploadImgAiMapper.xml index ce00d42..e956656 100644 --- a/src/main/resources/mappers/StuUploadImgAiMapper.xml +++ b/src/main/resources/mappers/StuUploadImgAiMapper.xml @@ -13,7 +13,7 @@ <result column="tch_score" jdbcType="DOUBLE" property="tchScore" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="sufxx" jdbcType="VARCHAR" property="sufxx" /> - <result column="append" jdbcType="VARCHAR" property="append" /> + <result column="school_id" jdbcType="VARCHAR" property="schoolId" /> </resultMap> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUploadImgAi"> <result column="tch_comment" jdbcType="LONGVARCHAR" property="tchComment" /> @@ -78,7 +78,7 @@ </sql> <sql id="Base_Column_List"> id, user_id, file_path, create_time, upload_number, file_size, file_name, module, - tch_score, update_time, sufxx, append + tch_score, update_time, sufxx, school_id </sql> <sql id="Blob_Column_List"> tch_comment @@ -135,12 +135,12 @@ insert into stu_upload_img_ai (id, user_id, file_path, create_time, upload_number, file_size, file_name, module, tch_score, - update_time, sufxx, append, + update_time, sufxx, school_id, tch_comment) values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{uploadNumber,jdbcType=INTEGER}, #{fileSize,jdbcType=DOUBLE}, #{fileName,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, #{tchScore,jdbcType=DOUBLE}, - #{updateTime,jdbcType=TIMESTAMP}, #{sufxx,jdbcType=VARCHAR}, #{append,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, #{sufxx,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, #{tchComment,jdbcType=LONGVARCHAR}) </insert> <insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi"> @@ -179,8 +179,8 @@ <if test="sufxx != null"> sufxx, </if> - <if test="append != null"> - append, + <if test="schoolId != null"> + school_id, </if> <if test="tchComment != null"> tch_comment, @@ -220,8 +220,8 @@ <if test="sufxx != null"> #{sufxx,jdbcType=VARCHAR}, </if> - <if test="append != null"> - #{append,jdbcType=VARCHAR}, + <if test="schoolId != null"> + #{schoolId,jdbcType=VARCHAR}, </if> <if test="tchComment != null"> #{tchComment,jdbcType=LONGVARCHAR}, @@ -234,6 +234,7 @@ <include refid="Example_Where_Clause" /> </if> </select> + <update id="updateByExampleSelective" parameterType="map"> update stu_upload_img_ai <set> @@ -270,8 +271,8 @@ <if test="record.sufxx != null"> sufxx = #{record.sufxx,jdbcType=VARCHAR}, </if> - <if test="record.append != null"> - append = #{record.append,jdbcType=VARCHAR}, + <if test="record.schoolId != null"> + school_id = #{record.schoolId,jdbcType=VARCHAR}, </if> <if test="record.tchComment != null"> tch_comment = #{record.tchComment,jdbcType=LONGVARCHAR}, @@ -294,7 +295,7 @@ tch_score = #{record.tchScore,jdbcType=DOUBLE}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, sufxx = #{record.sufxx,jdbcType=VARCHAR}, - append = #{record.append,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR}, tch_comment = #{record.tchComment,jdbcType=LONGVARCHAR} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> @@ -313,7 +314,7 @@ tch_score = #{record.tchScore,jdbcType=DOUBLE}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, sufxx = #{record.sufxx,jdbcType=VARCHAR}, - append = #{record.append,jdbcType=VARCHAR} + school_id = #{record.schoolId,jdbcType=VARCHAR} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> @@ -351,8 +352,8 @@ <if test="sufxx != null"> sufxx = #{sufxx,jdbcType=VARCHAR}, </if> - <if test="append != null"> - append = #{append,jdbcType=VARCHAR}, + <if test="schoolId != null"> + school_id = #{schoolId,jdbcType=VARCHAR}, </if> <if test="tchComment != null"> tch_comment = #{tchComment,jdbcType=LONGVARCHAR}, @@ -372,7 +373,7 @@ tch_score = #{tchScore,jdbcType=DOUBLE}, update_time = #{updateTime,jdbcType=TIMESTAMP}, sufxx = #{sufxx,jdbcType=VARCHAR}, - append = #{append,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR}, tch_comment = #{tchComment,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=INTEGER} </update> @@ -388,7 +389,22 @@ tch_score = #{tchScore,jdbcType=DOUBLE}, update_time = #{updateTime,jdbcType=TIMESTAMP}, sufxx = #{sufxx,jdbcType=VARCHAR}, - append = #{append,jdbcType=VARCHAR} + school_id = #{schoolId,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} </update> + + +<!-- <select id="selectInfoBySchoolId" resultType="com.sztzjy.marketing.entity.dto.TchrePortPresentationDTO">--> +<!-- select s.name as name , s.student_id as studentId, s.class_name as className,--> +<!-- i.module as module ,i.file_name as fileName ,i.create_time as createTime ,i.file_size as fileSize--> +<!-- from stu_upload_img_ai i--> +<!-- join--> +<!-- stu_user s--> +<!-- on--> +<!-- i.user_id = s.user_id--> +<!-- where--> +<!-- s.school_id = #{schoolId}--> +<!-- order by--> +<!-- i.create_time asc--> +<!-- </select>--> </mapper> \ No newline at end of file diff --git a/src/main/resources/mappers/StuUserMapper.xml b/src/main/resources/mappers/StuUserMapper.xml index 1a7df4b..eef7176 100644 --- a/src/main/resources/mappers/StuUserMapper.xml +++ b/src/main/resources/mappers/StuUserMapper.xml @@ -244,7 +244,8 @@ <include refid="Example_Where_Clause" /> </if> </select> - <update id="updateByExampleSelective" parameterType="map"> + + <update id="updateByExampleSelective" parameterType="map"> update stu_user <set> <if test="record.userId != null"> @@ -400,4 +401,47 @@ total_score = #{totalScore,jdbcType=DECIMAL} where user_id = #{userId,jdbcType=VARCHAR} </update> + + + <select id="selectByCondition" resultType="com.sztzjy.marketing.entity.dto.StuUserDto"> + SELECT + u.user_id AS userId, + u.name AS name, + u.student_id AS studentId, + r.module AS module, + u.class_name AS className, + r.file_path AS reportUrl, + r.id AS reportId, + r.tch_score AS rating + FROM + stu_user u + JOIN + stu_upload_img_ai r ON u.user_id = r.user_id + <where> + AND u.school_id = #{schoolId} + <if test="module != null"> + AND r.module = #{module} + </if> + <if test="name != null"> + AND u.name LIKE CONCAT('%', #{name}, '%') + </if> + <if test="studentId != null"> + AND u.student_id LIKE CONCAT('%', #{studentId}, '%') + </if> + <if test="className != null"> + AND u.class_name LIKE CONCAT('%', #{className}, '%') + </if> + <if test="keyWord != null"> + AND r.module LIKE CONCAT('%', #{keyWord}, '%') + </if> + </where> + ORDER BY + r.tch_score DESC + </select> + <select id="getClassNameBySchoolId" resultType="java.lang.String"> + select class_name from stu_user + where school_id = #{schoolId} + group by class_name + </select> + </mapper> \ No newline at end of file