Commit beb6eb75 by 284718418@qq.com

民族字典 基础代码命名格式优化

parent c4641bfe
package cn.timer.api.dto.yggl;
package cn.timer.api.bean.clazz;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
......@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -25,7 +26,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@TableName("nation_class")
@ApiModel("民族")
public class YgmzDto {
public class NationClass extends Model<NationClass> {
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
......
......@@ -111,7 +111,7 @@ import cn.timer.api.dao.kqmk.KqglAssoKqzdkfsMapper;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.clazz.NationClassMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
......@@ -130,7 +130,7 @@ import cn.timer.api.dto.yggl.YgKVDto;
import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.bean.clazz.NationClass;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.DateFormatUtils;
import cn.timer.api.utils.Md5;
......@@ -170,7 +170,7 @@ public class YgglController {
// weng(民族)
@Autowired
private YgMzDtoMapper ygMzDtoMapper;
private NationClassMapper nationClassMapper;
@Resource
private RedisUtil redisUtil;
......@@ -1558,12 +1558,12 @@ public class YgglController {
@PostMapping(value = "/mz/{id}")
@ApiOperation(value = "60.展示民族/展示所有民族", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 60)
public Result<List<YgmzDto>> selectmzs(@PathVariable Integer id) {
public Result<List<NationClass>> selectmzs(@PathVariable Integer id) {
if (id == null || id == 0) {
List<YgmzDto> allmz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).list();
List<NationClass> allmz = new LambdaQueryChainWrapper<NationClass>(nationClassMapper).list();
return ResultUtil.data(allmz, "展示所有民族");
}
List<YgmzDto> mz = new LambdaQueryChainWrapper<YgmzDto>(ygMzDtoMapper).eq(YgmzDto::getNumber, id).list();
List<NationClass> mz = new LambdaQueryChainWrapper<NationClass>(nationClassMapper).eq(NationClass::getNumber, id).list();
return ResultUtil.data(mz, "展示该民族");
}
......
package cn.timer.api.dao.yggl;
package cn.timer.api.dao.clazz;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.bean.clazz.NationClass;
......@@ -12,6 +12,6 @@ import cn.timer.api.dto.yggl.YgmzDto;
* @author Tang 2019-11-15
*/
@Repository
public interface YgMzDtoMapper extends BaseMapper<YgmzDto> {
public interface NationClassMapper extends BaseMapper<NationClass> {
}
<?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.timer.api.dao.clazz.NationClassMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.clazz.NationClass" id="nationClassMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="pinyin" column="pinyin"/>
<result property="letter" column="letter"/>
<result property="number" column="number"/>
<result property="sort" column="sort"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment