写sql语句将数字字典数转换成汉字——sql

Controller

    /**
     * 通过学号获得学生荣誉列表
     * 通过学号获得学生荣誉列表
     * getStudentHonor
     */
    @AutoLog(value = "通过学号获得学生荣誉列表")
    @ApiOperation(value="通过学号获得学生荣誉列表", notes="通过学号获得学生荣誉列表")
    @GetMapping(value = "/getStudentHonor")
//    @RequiresPermissions("stStudent:getStStudent")
    public Result<?> getStudentHonor(@RequestParam(required = true) String stuId,
                                           HttpServletRequest req) {

        List<StHonor> stStateJilu = stHonorService.getStudentHonor(stuId);
        Result result=new Result();
        result.setResult(stStateJilu);
        return result;
    }

service

List<StHonor> getStudentHonor(String stuId);
@Override
    public List<StHonor> getStudentHonor(String stuId) {
        List<StHonor> StudentHonor= stHonorMapper.getStudentHonor(stuId);
        return StudentHonor;
    }

mapper

List<StHonor> getStudentHonor(@Param("stuId") String stuId);
   <select id="getStudentHonor" resultType="org.jeecg.modules.demo.st.entity.StHonor">
      SELECT
        st_honor.id id,
	    st_honor.st_name st_name,
	    sys_dict_item.item_text types,
	    st_honor.`name` name,
	    st_honor.year_one year_one,
	    st_honor.year_two year_two,
	    st_honor.description description,
	    st_honor.deleted photo
    FROM
	    st_honor
     LEFT JOIN sys_dict_item ON sys_dict_item.item_value = st_honor.types
    AND sys_dict_item.dict_id = "1216902849173159938"
    WHERE
	    st_honor.deleted='0'
    AND
	    st_honor. st_name=#{stuId}
    </select>
发布了125 篇原创文章 · 获赞 41 · 访问量 2728

猜你喜欢

转载自blog.csdn.net/qq_43618030/article/details/103973752