18 changed files with 741 additions and 0 deletions
@ -0,0 +1,65 @@ |
|||
package com.elink.esua.epdc.constant; |
|||
|
|||
/*** |
|||
* 综治及网格化常量 |
|||
* @author work@yujt.net.cn |
|||
* @date 2022/6/8/0008 10:00 |
|||
*/ |
|||
public interface EventZwyDataConstant { |
|||
|
|||
int PAGE_LIMIT = 200; |
|||
|
|||
String AESKEY = "hriajrutnbghajsd"; |
|||
|
|||
String TABLESCHEMA_UNICOM = "unicom"; |
|||
String TABLESCHEMA_SHARE = "share"; |
|||
String TABLESCHEMA_WGH = "wgh"; |
|||
String TABLESCHEMA_COMPANY = "company"; |
|||
|
|||
|
|||
String UNICOM_PINGFANG = "ca_pingfang"; |
|||
String UNICOM_LOUDONG = "ca_loudong"; |
|||
String UNICOM_RESIDENT = "ca_resident"; |
|||
String UNICOM_ROTATORS = "ca_rotators"; |
|||
String UNICOM_RENTAL = "ca_rental"; |
|||
String UNICOM_BM_CATEGORY = "ca_bm_category"; |
|||
String UNICOM_SYS_DICT = "ca_sys_dict"; |
|||
String UNICOM_KETTLE = "ca_kettle_base_dispute_process"; |
|||
|
|||
String SHARE_BASE_GRID = "wgh_base_grid"; |
|||
String SHARE_WGH_SUB = "wgh_subdistrict_office"; |
|||
String SHARE_BM_GRID = "ca_bm_grid"; |
|||
String SHARE_COMMUNITY = "wgh_community"; |
|||
String SHARE_WGH_DYWG = "wgh_dywg"; |
|||
String SHARE_WGH_JDB = "wgh_jdb"; |
|||
String SHARE_WGH_JQZ = "wgh_jqz"; |
|||
String SHARE_WGH_JXCS = "wgh_jxcs"; |
|||
String SHARE_WGH_JYZ = "wgh_jyz"; |
|||
String SHARE_WGH_SJXXB = "wgh_sjxxb"; |
|||
String SHARE_WGH_SQXX = "wgh_sqxx"; |
|||
String SHARE_WGH_SZCGWGH = "wgh_szcgwgh"; |
|||
String SHARE_WGH_SZZRWG = "wgh_szzrwg"; |
|||
String SHARE_WGH_WHPDW = "wgh_whpdw"; |
|||
String SHARE_WGH_YJBMCS = "wgh_yjbmcs"; |
|||
String SHARE_WGH_YQHJZ = "wgh_yqhjz"; |
|||
|
|||
|
|||
String SHARE_WGH_SJXX = "wgh_sjxx"; |
|||
|
|||
/** |
|||
* 政务云接口地址 |
|||
*/ |
|||
String DATA_URL_UNICON = "http://120.221.72.83:9090/bridge/unicom/page"; |
|||
String DATA_URL_SHARE = "http://120.221.72.83:9090/bridge/share/sharePage"; |
|||
String DATA_URL_WGH = "http://120.221.72.83:9090/bridge/wgh/wghPage"; |
|||
String DATA_URL_COMPANY = "http://120.221.72.83:9090/bridge/company/page"; |
|||
|
|||
/** |
|||
* 接口鉴权 |
|||
*/ |
|||
String UNICOM_CONDITION = "unicomCondition"; |
|||
String SHARE_CONDITION = "shareCondition"; |
|||
String WGH_CONDITION = "wghCondition"; |
|||
String COMPANY_CONDITION = "companyCondition"; |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.share; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Data |
|||
public class ShareEnterpriseDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String entName; |
|||
|
|||
/** |
|||
* 企业编码 |
|||
*/ |
|||
private String uniscid; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.share.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Data |
|||
public class ShareEnterpriseFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
@NotBlank(message = "企业名称不可为空") |
|||
private String entName; |
|||
|
|||
/** |
|||
* 企业编码 |
|||
*/ |
|||
private String uniscid; |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.share.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Data |
|||
public class ShareEnterpriseResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String entName; |
|||
|
|||
/** |
|||
* 企业编码 |
|||
*/ |
|||
private String uniscid; |
|||
|
|||
} |
@ -0,0 +1,92 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.share.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; |
|||
import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; |
|||
import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; |
|||
import com.elink.esua.epdc.modules.share.service.ShareEnterpriseService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("shareenterprise") |
|||
public class ShareEnterpriseController { |
|||
|
|||
@Autowired |
|||
private ShareEnterpriseService shareEnterpriseService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ShareEnterpriseDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ShareEnterpriseDTO> page = shareEnterpriseService.page(params); |
|||
return new Result<PageData<ShareEnterpriseDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ShareEnterpriseDTO> get(@PathVariable("id") String id){ |
|||
ShareEnterpriseDTO data = shareEnterpriseService.get(id); |
|||
return new Result<ShareEnterpriseDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ShareEnterpriseDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
shareEnterpriseService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
shareEnterpriseService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 获取企业信息 |
|||
* |
|||
* @param formDTO |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO>> |
|||
* @author zhy |
|||
* @date 2022/9/15 16:13 |
|||
*/ |
|||
@PostMapping("company") |
|||
public Result<List<ShareEnterpriseResultDTO>> getCompany(@RequestBody ShareEnterpriseFormDTO formDTO){ |
|||
List<ShareEnterpriseResultDTO> list = shareEnterpriseService.getCompany(formDTO); |
|||
return new Result<List<ShareEnterpriseResultDTO>>().ok(list); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.share.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Mapper |
|||
public interface ShareEnterpriseDao extends BaseDao<ShareEnterpriseEntity> { |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.share.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_share_enterprise") |
|||
public class ShareEnterpriseEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String entName; |
|||
|
|||
/** |
|||
* 企业编码 |
|||
*/ |
|||
private String uniscid; |
|||
|
|||
} |
@ -0,0 +1,107 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.share.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; |
|||
import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; |
|||
import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; |
|||
import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
public interface ShareEnterpriseService extends BaseService<ShareEnterpriseEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ShareEnterpriseDTO> |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
PageData<ShareEnterpriseDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ShareEnterpriseDTO> |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
List<ShareEnterpriseDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ShareEnterpriseDTO |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
ShareEnterpriseDTO get(String id); |
|||
|
|||
/** |
|||
* 查询企业信息 |
|||
* |
|||
* @param formDTO |
|||
* @return ShareEnterpriseDTO |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
List<ShareEnterpriseResultDTO> getCompany(ShareEnterpriseFormDTO formDTO); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
void save(ShareEnterpriseDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
void update(ShareEnterpriseDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-15 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,113 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.share.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; |
|||
import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; |
|||
import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; |
|||
import com.elink.esua.epdc.modules.share.dao.ShareEnterpriseDao; |
|||
import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; |
|||
import com.elink.esua.epdc.modules.share.service.ShareEnterpriseService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 政务网企业信息表 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2022-09-15 |
|||
*/ |
|||
@Service |
|||
public class ShareEnterpriseServiceImpl extends BaseServiceImpl<ShareEnterpriseDao, ShareEnterpriseEntity> implements ShareEnterpriseService { |
|||
|
|||
@Override |
|||
public PageData<ShareEnterpriseDTO> page(Map<String, Object> params) { |
|||
IPage<ShareEnterpriseEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ShareEnterpriseDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ShareEnterpriseDTO> list(Map<String, Object> params) { |
|||
List<ShareEnterpriseEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ShareEnterpriseDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ShareEnterpriseEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
String entName = (String) params.get("entName"); |
|||
|
|||
QueryWrapper<ShareEnterpriseEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
wrapper.like(StringUtils.isNotBlank(entName), "ent_name", entName); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ShareEnterpriseDTO get(String id) { |
|||
ShareEnterpriseEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ShareEnterpriseDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ShareEnterpriseResultDTO> getCompany(ShareEnterpriseFormDTO formDTO) { |
|||
Map<String, Object> params = new HashMap<>(4); |
|||
params.put("entName", formDTO.getEntName()); |
|||
List<ShareEnterpriseDTO> list = list(params); |
|||
return ConvertUtils.sourceToTarget(list, ShareEnterpriseResultDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ShareEnterpriseDTO dto) { |
|||
ShareEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ShareEnterpriseEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ShareEnterpriseDTO dto) { |
|||
ShareEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ShareEnterpriseEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
<?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="com.elink.esua.epdc.modules.share.dao.ShareEnterpriseDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity" id="shareEnterpriseMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="entName" column="ent_name"/> |
|||
<result property="uniscid" column="uniscid"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue