相关方需求变革
parent
1cb56a5c82
commit
a0dcdb61d3
|
@ -0,0 +1,39 @@
|
||||||
|
package com.zcloud.controller.api;
|
||||||
|
|
||||||
|
import com.zcloud.controller.base.BaseController;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
|
import com.zcloud.util.Warden;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/openApi/xfgUser")
|
||||||
|
public class ApiXgfUserController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XgfUserService xgfUserService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/synchronizationUserInfo")
|
||||||
|
@ResponseBody
|
||||||
|
public Object synchronizationUserInfo() throws Exception {
|
||||||
|
try {
|
||||||
|
PageData request = this.getPageData();
|
||||||
|
System.out.println(request.getString("infoList"));
|
||||||
|
List<PageData> infoList = Warden.getList(request.getString("infoList"));
|
||||||
|
xgfUserService.init(request);
|
||||||
|
Map<String, Object> response = new HashMap<String, Object>();
|
||||||
|
response.put("result", "response");
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("系统异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.zcloud.controller.api.dto;
|
||||||
|
|
||||||
|
public class XgfUserDto {
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.zcloud.controller.xgf;
|
||||||
|
|
||||||
|
import com.zcloud.controller.base.BaseController;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.service.system.UsersService;
|
||||||
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
|
import com.zcloud.util.HttpClientService;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/xgf/user")
|
||||||
|
public class XgfUserController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XgfUserService xgfUserService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/list")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getLevels(Page page) throws Exception {
|
||||||
|
PageData request = this.getPageData();
|
||||||
|
page.setPd(request);
|
||||||
|
xgfUserService.list(page);
|
||||||
|
PageData response = new PageData();
|
||||||
|
response.put("result", "success");
|
||||||
|
response.put("page", page);
|
||||||
|
response.put("data", request);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.zcloud.mapper.datasource.xgf;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface XgfUserDetailsMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**列表(根据多选ID查询数据)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listByIds(PageData pd);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.zcloud.mapper.datasource.xgf;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface XgfUserMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**列表(根据多选ID查询数据)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listByIds(PageData pd);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.zcloud.service.xgf;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface XgfUserService {
|
||||||
|
|
||||||
|
void save(PageData pd) throws Exception;
|
||||||
|
|
||||||
|
void saveDetail(PageData pd) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> list(Page page) throws Exception;
|
||||||
|
|
||||||
|
void init(PageData request);
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zcloud.service.xgf.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
|
||||||
|
import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
|
||||||
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
|
import com.zcloud.util.Warden;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class XgfUserServiceImpl implements XgfUserService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XgfUserMapper xgfUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private XgfUserDetailsMapper xgfUserDetailsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(PageData pd) throws Exception {
|
||||||
|
xgfUserMapper.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveDetail(PageData pd) throws Exception {
|
||||||
|
xgfUserDetailsMapper.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> list(Page page) throws Exception {
|
||||||
|
return xgfUserDetailsMapper.listPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void init(PageData request) {
|
||||||
|
List<PageData> list = Warden.getList(request.getString("infoList"));
|
||||||
|
for (PageData x : list) {
|
||||||
|
try {
|
||||||
|
PageData condition = new PageData();
|
||||||
|
if (StringUtils.isNotBlank(x.getString("USER_ID"))) {
|
||||||
|
condition.put("USER_ID", x.getString("USER_ID"));
|
||||||
|
PageData entity = xgfUserMapper.findById(condition);
|
||||||
|
if (entity == null || entity.size() <= 0) {
|
||||||
|
x.put("XGF_USER_ID", x.get("USER_ID"));
|
||||||
|
x.put("XGF_USER_DETAILS_ID", x.get("XGF_USER_ID"));
|
||||||
|
x.put("ISDELETE","0");
|
||||||
|
xgfUserMapper.save(x);
|
||||||
|
xgfUserDetailsMapper.save(x);
|
||||||
|
} else {
|
||||||
|
x.put("XGF_USER_ID", x.get("USER_ID"));
|
||||||
|
x.put("XGF_USER_DETAILS_ID", x.get("XGF_USER_ID"));
|
||||||
|
x.put("ISDELETE","0");
|
||||||
|
xgfUserMapper.edit(x);
|
||||||
|
xgfUserDetailsMapper.edit(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("保存数据失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,286 @@
|
||||||
|
<?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.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
XGF_USER_DETAILS
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.XFG_USER_DETAILS_ID,
|
||||||
|
f.XGF_USER_ID,
|
||||||
|
f.XGF_USER_NAME,
|
||||||
|
f.BELONG_TO_CORP,
|
||||||
|
f.BELONG_TO_CORP_NAME,
|
||||||
|
f.PHONE,
|
||||||
|
f.CREAT_TIME,
|
||||||
|
f.DEPART_STATE,
|
||||||
|
f.ISDELETE,
|
||||||
|
f.AGE,
|
||||||
|
f.HKLOCAL,
|
||||||
|
f.ADDRESS,
|
||||||
|
f.DEGREE_OF_EDUCATION,
|
||||||
|
f.DEGREE_OF_EDUCATION_NAME,
|
||||||
|
f.CORP_START_DATE,
|
||||||
|
f.POST_ID,
|
||||||
|
f.POST_NAME,
|
||||||
|
f.WORK_SIGN,
|
||||||
|
f.JOINED_DATE,
|
||||||
|
f.WORK_DATE,
|
||||||
|
f.PHOTO,
|
||||||
|
f.DATE_OF_BIRTH,
|
||||||
|
f.ISPAY,
|
||||||
|
f.ISPAY_NUMBER,
|
||||||
|
f.IS_SAFETY_TELL,
|
||||||
|
f.IS_SAFETY_TIME,
|
||||||
|
f.IS_INJURIES_PAY,
|
||||||
|
f.IS_SIGN_LABOR,
|
||||||
|
f.SEX,
|
||||||
|
f.ENTRY_DATE,
|
||||||
|
f.PERSON_WORK_TYPE,
|
||||||
|
f.PERSON_WORK_TYPE_NAME,
|
||||||
|
f.NATIONALITY,
|
||||||
|
f.NATIONALITY_NAME,
|
||||||
|
f.POLITICAL_TIME,
|
||||||
|
f.POLITICAL_STATUS,
|
||||||
|
f.POLITICAL_STATUS_NAME,
|
||||||
|
f.IS_INJURIES_PAY_TIME,
|
||||||
|
f.IS_LEVEL_THREE,
|
||||||
|
f.IS_BODY_ADAPT,
|
||||||
|
f.IS_SPECIAL_JOB,
|
||||||
|
f.CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
XFG_USER_DETAILS_ID,
|
||||||
|
XGF_USER_ID,
|
||||||
|
XGF_USER_NAME,
|
||||||
|
BELONG_TO_CORP,
|
||||||
|
BELONG_TO_CORP_NAME,
|
||||||
|
PHONE,
|
||||||
|
CREAT_TIME,
|
||||||
|
DEPART_STATE,
|
||||||
|
ISDELETE,
|
||||||
|
AGE,
|
||||||
|
HKLOCAL,
|
||||||
|
ADDRESS,
|
||||||
|
DEGREE_OF_EDUCATION,
|
||||||
|
DEGREE_OF_EDUCATION_NAME,
|
||||||
|
CORP_START_DATE,
|
||||||
|
POST_ID,
|
||||||
|
POST_NAME,
|
||||||
|
WORK_SIGN,
|
||||||
|
JOINED_DATE,
|
||||||
|
WORK_DATE,
|
||||||
|
PHOTO,
|
||||||
|
DATE_OF_BIRTH,
|
||||||
|
ISPAY,
|
||||||
|
ISPAY_NUMBER,
|
||||||
|
IS_SAFETY_TELL,
|
||||||
|
IS_SAFETY_TIME,
|
||||||
|
IS_INJURIES_PAY,
|
||||||
|
IS_SIGN_LABOR,
|
||||||
|
SEX,
|
||||||
|
ENTRY_DATE,
|
||||||
|
PERSON_WORK_TYPE,
|
||||||
|
PERSON_WORK_TYPE_NAME,
|
||||||
|
NATIONALITY,
|
||||||
|
NATIONALITY_NAME,
|
||||||
|
POLITICAL_TIME,
|
||||||
|
POLITICAL_STATUS,
|
||||||
|
POLITICAL_STATUS_NAME,
|
||||||
|
IS_INJURIES_PAY_TIME,
|
||||||
|
IS_LEVEL_THREE,
|
||||||
|
IS_BODY_ADAPT,
|
||||||
|
IS_SPECIAL_JOB,
|
||||||
|
CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{XFG_USER_DETAILS_ID}
|
||||||
|
,
|
||||||
|
#{XGF_USER_ID},
|
||||||
|
#{XGF_USER_NAME},
|
||||||
|
#{BELONG_TO_CORP},
|
||||||
|
#{BELONG_TO_CORP_NAME},
|
||||||
|
#{PHONE},
|
||||||
|
#{CREAT_TIME},
|
||||||
|
#{DEPART_STATE},
|
||||||
|
#{ISDELETE},
|
||||||
|
#{AGE},
|
||||||
|
#{HKLOCAL},
|
||||||
|
#{ADDRESS},
|
||||||
|
#{DEGREE_OF_EDUCATION},
|
||||||
|
#{DEGREE_OF_EDUCATION_NAME},
|
||||||
|
#{CORP_START_DATE},
|
||||||
|
#{POST_ID},
|
||||||
|
#{POST_NAME},
|
||||||
|
#{WORK_SIGN},
|
||||||
|
#{JOINED_DATE},
|
||||||
|
#{WORK_DATE},
|
||||||
|
#{PHOTO},
|
||||||
|
#{DATE_OF_BIRTH},
|
||||||
|
#{ISPAY},
|
||||||
|
#{ISPAY_NUMBER},
|
||||||
|
#{IS_SAFETY_TELL},
|
||||||
|
#{IS_SAFETY_TIME},
|
||||||
|
#{IS_INJURIES_PAY},
|
||||||
|
#{IS_SIGN_LABOR},
|
||||||
|
#{SEX},
|
||||||
|
#{ENTRY_DATE},
|
||||||
|
#{PERSON_WORK_TYPE},
|
||||||
|
#{PERSON_WORK_TYPE_NAME},
|
||||||
|
#{NATIONALITY},
|
||||||
|
#{NATIONALITY_NAME},
|
||||||
|
#{POLITICAL_TIME},
|
||||||
|
#{POLITICAL_STATUS},
|
||||||
|
#{POLITICAL_STATUS_NAME},
|
||||||
|
#{IS_INJURIES_PAY_TIME},
|
||||||
|
#{IS_LEVEL_THREE},
|
||||||
|
#{IS_BODY_ADAPT},
|
||||||
|
#{IS_SPECIAL_JOB},
|
||||||
|
#{CORPINFO_ID}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
XGF_USER_ID = #{XGF_USER_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID},
|
||||||
|
XGF_USER_ID = #{XGF_USER_ID},
|
||||||
|
XGF_USER_NAME = #{XGF_USER_NAME},
|
||||||
|
BELONG_TO_CORP = #{BELONG_TO_CORP},
|
||||||
|
BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME},
|
||||||
|
PHONE = #{PHONE},
|
||||||
|
CREAT_TIME = #{CREAT_TIME},
|
||||||
|
DEPART_STATE = #{DEPART_STATE},
|
||||||
|
ISDELETE = #{ISDELETE},
|
||||||
|
AGE = #{AGE},
|
||||||
|
HKLOCAL = #{HKLOCAL},
|
||||||
|
ADDRESS = #{ADDRESS},
|
||||||
|
DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION},},
|
||||||
|
DEGREE_OF_EDUCATION_NAME = #{DEGREE_OF_EDUCATION_NAME},
|
||||||
|
CORP_START_DATE = #{CORP_START_DATE},
|
||||||
|
POST_ID = #{POST_ID},
|
||||||
|
POST_NAME = #{POST_NAME},
|
||||||
|
WORK_SIGN = #{WORK_SIGN},
|
||||||
|
JOINED_DATE = #{JOINED_DATE},
|
||||||
|
WORK_DATE = #{WORK_DATE},
|
||||||
|
PHOTO = #{PHOTO},
|
||||||
|
DATE_OF_BIRTH = #{DATE_OF_BIRTH},
|
||||||
|
ISPAY = #{ISPAY},
|
||||||
|
ISPAY_NUMBER = #{ISPAY_NUMBER},
|
||||||
|
IS_SAFETY_TELL = #{IS_SAFETY_TELL},
|
||||||
|
IS_SAFETY_TIME = #{IS_SAFETY_TIME},
|
||||||
|
IS_INJURIES_PAY = #{IS_INJURIES_PAY},
|
||||||
|
IS_SIGN_LABOR = #{IS_SIGN_LABOR},
|
||||||
|
SEX = #{SEX},
|
||||||
|
ENTRY_DATE = #{ENTRY_DATE},
|
||||||
|
PERSON_WORK_TYPE = #{PERSON_WORK_TYPE},
|
||||||
|
PERSON_WORK_TYPE_NAME = #{PERSON_WORK_TYPE_NAME},
|
||||||
|
NATIONALITY = #{NATIONALITY},
|
||||||
|
NATIONALITY_NAME = #{NATIONALITY_NAME},
|
||||||
|
POLITICAL_TIME = #{POLITICAL_TIME},
|
||||||
|
POLITICAL_STATUS = #{POLITICAL_STATUS},
|
||||||
|
POLITICAL_STATUS_NAME = #{POLITICAL_STATUS_NAME},
|
||||||
|
IS_INJURIES_PAY_TIME = #{IS_INJURIES_PAY_TIME},
|
||||||
|
IS_LEVEL_THREE = #{IS_LEVEL_THREE},
|
||||||
|
IS_BODY_ADAPT = #{IS_BODY_ADAPT},
|
||||||
|
IS_SPECIAL_JOB = #{IS_SPECIAL_JOB},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
where
|
||||||
|
XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where
|
||||||
|
f.XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="listPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
|
||||||
|
</if>
|
||||||
|
ORDER BY f.CREATED_TIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1',
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME}
|
||||||
|
where
|
||||||
|
XFG_USER_DETAILS_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 列表(根据多选ID查询数据) -->
|
||||||
|
<select id="listByIds" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
and XFG_USER_DETAILS_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,150 @@
|
||||||
|
<?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.zcloud.mapper.datasource.xgf.XgfUserMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
XGF_USER
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.XGF_USER_ID,
|
||||||
|
f.USERNAME,
|
||||||
|
f.NAME,
|
||||||
|
f.VALID_FLAG,
|
||||||
|
f.BELONG_TO_CORP,
|
||||||
|
f.BELONG_TO_CORP_NAME,
|
||||||
|
f.ISDELETE,
|
||||||
|
f.CREATED_TIME,
|
||||||
|
f.CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
XGF_USER_ID,
|
||||||
|
USERNAME,
|
||||||
|
NAME,
|
||||||
|
VALID_FLAG,
|
||||||
|
BELONG_TO_CORP,
|
||||||
|
BELONG_TO_CORP_NAME,
|
||||||
|
ISDELETE,
|
||||||
|
CREATED_TIME,
|
||||||
|
CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{XGF_USER_ID},
|
||||||
|
#{USERNAME},
|
||||||
|
#{NAME},
|
||||||
|
#{VALID_FLAG},
|
||||||
|
#{BELONG_TO_CORP},
|
||||||
|
#{BELONG_TO_CORP_NAME},
|
||||||
|
#{ISDELETE},
|
||||||
|
#{CREATED_TIME},
|
||||||
|
#{CORPINFO_ID}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
XGF_USER_ID = #{XGF_USER_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
USERNAME = #{USERNAME},
|
||||||
|
NAME = #{NAME},
|
||||||
|
VALID_FLAG = #{VALID_FLAG},
|
||||||
|
BELONG_TO_CORP = #{BELONG_TO_CORP},
|
||||||
|
BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME},
|
||||||
|
ISDELETE = #{ISDELETE},
|
||||||
|
CREATED_TIME = #{CREATED_TIME},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
where
|
||||||
|
XGF_USER_ID = #{XGF_USER_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.XGF_USER_ID = #{XGF_USER_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="listPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
|
||||||
|
</if>
|
||||||
|
ORDER BY f.CREATED_TIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1',
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME}
|
||||||
|
where
|
||||||
|
SPECIALEQUIPMENT_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 列表(根据多选ID查询数据) -->
|
||||||
|
<select id="listByIds" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
and XGF_USER_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue