| | |
| | | import com.lf.server.entity.ctrl.TabEntity; |
| | | import com.lf.server.entity.data.DomainEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.data.DomainService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据表名查询值域名称") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "b_hy20w_s23") |
| | | }) |
| | | @GetMapping(value = "/selectDomainNames") |
| | | public ResponseMsg<List<String>> selectDomainNames(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("名称空间和表名不能为空", null); |
| | | } |
| | | |
| | | List<String> list = domainService.selectDomainNames(ns, tab); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | |
| | | return fail("密码不符合要求"); |
| | | } |
| | | |
| | | String ids = StringHelper.join(reqEntity.getIds(), ","); |
| | | |
| | | |
| | | return success(true); |
| | | } catch (Exception ex) { |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | public static boolean checkPwdValid(String pwd) { |
| | | return Pattern.matches(StaticData.PWD_REG, pwd); |
| | | } |
| | | |
| | | /** |
| | | * 连接List集合 |
| | | * @param list 整数集合 |
| | | * @param join 连接字符 |
| | | * @return |
| | | */ |
| | | public static String join(List<Integer> list, String join) { |
| | | if (null == list || list.isEmpty()) { |
| | | return ""; |
| | | } |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Integer i : list) { |
| | | if (null != i) { |
| | | sb.append(i.toString() + join); |
| | | } |
| | | } |
| | | |
| | | if (sb.length() > 0 && sb.lastIndexOf(join) == sb.length() - 1) { |
| | | sb.deleteCharAt(sb.length() -1 ); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询值域表集合 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<TabEntity> selectDomainTabs(); |
| | | |
| | | /** |
| | | * 根据表名查询值域名称 |
| | | * |
| | | * @param ns 名称空间 |
| | | * @param tab 表名 |
| | | * @return 值域名称集合 |
| | | */ |
| | | public List<String> selectDomainNames(String ns, String tab); |
| | | |
| | | /** |
| | | * 插入一条 |
| | | * |
| | | * @param entity |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectDomainNames(String ns, String tab) { |
| | | return domainMapper.selectDomainNames(ns, tab); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(DomainEntity entity) { |
| | | return domainMapper.insert(entity); |
| | | } |
| | |
| | | select distinct ns,tab,tab_desc,tableType from lf.sys_dict where domain_na is not null order by ns,tab |
| | | </select> |
| | | |
| | | <select id="selectDomainNames" resultType="java.lang.String"> |
| | | select domain_na from lf.sys_dict where ns = #{ns} and tab = #{tab} and domain_na is not null group by domain_na |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.data.DomainEntity"> |
| | | insert into lf.sys_domain |
| | | (dom_desc,dom_name,dom_code,code_desc,level,orderid,bsm,create_user,create_time,bak) |