当前位置: 首页 > news >正文

网站做等保二级收费多少电商网站建设 网站定制开发

网站做等保二级收费多少,电商网站建设 网站定制开发,企业网站的设计论文,中英文网站怎么实现问题1:不使用collection 聚合分页正确 简单列子 T_ATOM_DICT表有 idname1原子12原子23原子34原子45原子56原子6 T_ATOM_DICT_AUDIT_ROUTE表审核记录表有 idaudit1拒绝1通过4拒绝 我要显示那些原子审核了,我把两个表inner join 就是那些原子审核过了 idnameaudit1原子1拒绝…

问题1:不使用collection 聚合分页正确
简单列子
T_ATOM_DICT表有

idname
1原子1
2原子2
3原子3
4原子4
5原子5
6原子6

T_ATOM_DICT_AUDIT_ROUTE表审核记录表有

idaudit
1拒绝
1通过
4拒绝

我要显示那些原子审核了,我把两个表inner join 就是那些原子审核过了

idnameaudit
1原子1拒绝
1原子1通过
4原子4拒绝

在这里插入图片描述
mapper

    IPage<AtomDict> findAllByAuditRouteNoDuplicate(@Param("criteria") AtomDictQueryCriteria criteria, Page<Object> page);

xml基础的查询类型和返回类型

<!--    分步要用-->
<resultMap id="BaseResultMap" type="com.njry.sjzl.busi.domain.AtomDict"><result column="ATOM_ID" property="atomId"/><result column="ATOM_ID" property="id"/><result column="CATEGORY_ID" property="categoryId"/><result column="CATEGORY_NAME" property="categoryName"/><result column="ATOM_NAME" property="atomName"/><result column="TYPE" property="type"/><result column="TYPE_NAME" property="typeName" /><result column="DATA_CYCLE" property="dataCycle"/><result column="DATA_CYCLE_NAME" property="dataCycleName"/><result column="LIB_TYPE" property="libType"/>
<!--        <result column="AUDIT_RESULT" property="auditResult"/>-->
<!--        <result column="AUDIT_REMARK" property="auditRemark"/>--><result column="LIB_TYPE_NAME" property="libTypeName"/><result column="DATA_GENE_MODE" property="dataGeneMode"/><result column="DATA_GENE_MODE_NAME" property="dataGeneModeName"/><result column="TEMPLATE_ID" property="templateId"/><result column="TEMPLATE_NAME" property="templateName"/><result column="DATABASE" property="database"/><result column="DATABASE_NAME" property="databaseName"/><result column="DATABASE_TABLE" property="databaseTable"/><result column="COLUMN_NAME" property="columnName"/><result column="TABLE_LEVEL" property="tableLevel"/><result column="PROC_NAME" property="procName"/><result column="IS_HZ" property="isHz"/><result column="STATUS" property="status"/><result column="ATOM_TABLE" property="atomTable"/><result column="MODE_FLAG" property="modeFlag"/><result column="CREATE_ID" property="createId"/><result column="CREATE_DATE" property="createDate"/><result column="REC_ID" property="recId"/><result column="REC_DATE" property="recDate"/><result column="SH_ID" property="shId"/><result column="SH_DATE" property="shDate"/><result column="SH_REMARK" property="shRemark"/><result column="DEL_ID" property="delId"/><result column="DEL_DATE" property="delDate"/><result column="START_DATE" property="startDate"/><result column="END_DATE" property="endDate"/><result column="UNIT" property="unit"/><result column="DIMEN_FLAG" property="dimenFlag"/></resultMap><resultMap id="BaseResultMapBoss" type="com.njry.sjzl.busi.domain.AtomDict"><result column="ATOM_ID" property="atomId"/><result column="ATOM_ID" property="id"/><result column="CATEGORY_ID" property="categoryId"/><result column="CATEGORY_NAME" property="categoryName"/><result column="ATOM_NAME" property="atomName"/><result column="TYPE" property="type"/><result column="TYPE_NAME" property="typeName" /><result column="DATA_CYCLE" property="dataCycle"/><result column="DATA_CYCLE_NAME" property="dataCycleName"/><result column="LIB_TYPE" property="libType"/><result column="LIB_TYPE_NAME" property="libTypeName"/><result column="DATA_GENE_MODE" property="dataGeneMode"/><result column="DATA_GENE_MODE_NAME" property="dataGeneModeName"/><result column="TEMPLATE_ID" property="templateId"/><result column="TEMPLATE_NAME" property="templateName"/><result column="DATABASE" property="database"/><result column="DATABASE_NAME" property="databaseName"/><result column="DATABASE_TABLE" property="databaseTable"/><result column="COLUMN_NAME" property="columnName"/><result column="TABLE_LEVEL" property="tableLevel"/><result column="PROC_NAME" property="procName"/><result column="IS_HZ" property="isHz"/><result column="STATUS" property="status"/><result column="ATOM_TABLE" property="atomTable"/><result column="MODE_FLAG" property="modeFlag"/><result column="CREATE_ID" property="createId"/><result column="CREATE_DATE" property="createDate"/><result column="REC_ID" property="recId"/><result column="REC_DATE" property="recDate"/><result column="SH_ID" property="shId"/><result column="SH_DATE" property="shDate"/><result column="SH_REMARK" property="shRemark"/><result column="DEL_ID" property="delId"/><result column="DEL_DATE" property="delDate"/><result column="START_DATE" property="startDate"/><result column="END_DATE" property="endDate"/><result column="UNIT" property="unit"/><result column="DIMEN_FLAG" property="dimenFlag"/></resultMap>
<!--    <collection property="batchList" resultMap="BatchListResultMap"/>-->
<!--    审核表数据还得关联用户表显示用户名--><resultMap id="BatchListResultMap" type="com.njry.sjzl.busi.domain.AtomDictAuditRoute"><result column="ROUTE_ID" property="routeId"/><result column="ROUTE_ID" property="id"/><result column="ATOM_IDREPEAT" property="atomId"/><result column="AUDIT_RESULT" property="auditResult"/><result column="AUDIT_REMARK" property="auditRemark"/><result column="AUDIT_ID" property="auditId"/><result column="AUDIT_NAME" property="auditName"/><result column="AUDIT_DATE" property="auditDate"/></resultMap><sql id="BathList_Column_List">auditroute.ROUTE_ID as ROUTE_ID, auditroute.ATOM_ID as ATOM_IDREPEAT, tuser.NAME AS AUDIT_NAME,auditroute.AUDIT_RESULT as AUDIT_RESULT, auditroute.AUDIT_REMARK as AUDIT_REMARK,auditroute.AUDIT_ID as AUDIT_ID,auditroute.AUDIT_DATE as AUDIT_DATE</sql><sql id="Base_Column_List">tad.ATOM_ID, tad.CATEGORY_ID, tad.ATOM_NAME, tad.TYPE, tad.DATA_CYCLE, tad.LIB_TYPE, tad.DATA_GENE_MODE, tad.TEMPLATE_ID, tad.DATABASE_TABLE, tad."DATABASE",tad.COLUMN_NAME, tad.TABLE_LEVEL, tad.PROC_NAME, tad.IS_HZ, tad.STATUS, tad.ATOM_TABLE, tad.MODE_FLAG, tad.CREATE_ID,tad.CREATE_DATE, tad.REC_ID, tad.REC_DATE, tad.SH_ID, tad.SH_DATE, tad.SH_REMARK, tad.DEL_ID, tad.DEL_DATE, tad.START_DATE, tad.END_DATE, tad.UNIT, tad.DIMEN_FLAG</sql>
<!--    数据字典回显名字--><sql id="Dict_Detail_Column_List">dtable.label AS DATABASE_NAME,dtable1.label AS DATA_GENE_MODE_NAME,dtable2.label AS LIB_TYPE_NAME,dtable3.label AS DATA_CYCLE_NAME,dtable4.label AS TYPE_NAME</sql>

真正xml如下:关联很多表回显,T_ATOM_TEMPLATE模板表,T_ATOM_BUSI_CATEGORY业务分类,五个字典表,和(原子审核表,原子审核表要关联用户表差审核用户名)

    <select id="findAllByAuditRouteNoDuplicate" resultMap="BaseResultMapBoss">select tatempalte.TEMPLATE_NAME,tabc.CATEGORY_NAME AS CATEGORY_NAME,<include refid="Base_Column_List"/>,<include refid="Dict_Detail_Column_List"/>,<include refid="BathList_Column_List"/>from T_ATOM_DICT tadleft join T_ATOM_TEMPLATE tatempalte on tatempalte.TEMPLATE_ID = tad.TEMPLATE_IDleft join T_ATOM_BUSI_CATEGORY tabc on tad.CATEGORY_ID = tabc.category_idleft join (select dd.label,dd.value from t_dict d left join t_dict_detail dd on  dd.dict_id = d.dict_idwhere d.name = 'asset_archive_name') dtableon tad.DATABASE = dtable.valueleft join (select dd1.label,dd1.value from t_dict d1 left join t_dict_detail dd1 on  dd1.dict_id = d1.dict_idwhere d1.name = 't_atmo_dict_generation_mechanism') dtable1on tad.DATA_GENE_MODE = dtable1.valueleft join (select dd2.label,dd2.value from t_dict d2 left join t_dict_detail dd2 on  dd2.dict_id = d2.dict_idwhere d2.name = 't_atmo_dict_atomic_library_type') dtable2on tad.LIB_TYPE = dtable2.valueleft join (select dd3.label,dd3.value from t_dict d3 left join t_dict_detail dd3 on  dd3.dict_id = d3.dict_idwhere d3.name = 't_atmo_dict_data_cycle') dtable3on tad.DATA_CYCLE = dtable3.valueleft join (select dd4.label,dd4.value from t_dict d4 left join t_dict_detail dd4 on  dd4.dict_id = d4.dict_idwhere d4.name = 't_atmo_dict_data_type') dtable4on tad.TYPE = dtable4.valueinner join (select ATOM_ID,AUDIT_RESULT,AUDIT_REMARK,ROUTE_ID,AUDIT_ID,AUDIT_DATEfrom T_ATOM_DICT_AUDIT_ROUTE) auditroute on auditroute.ATOM_ID =tad.ATOM_IDleft join t_user tuser on tuser.oper_id = auditroute.AUDIT_ID<where><if test="criteria.atomId != null">and tad.ATOM_ID = #{criteria.atomId}</if><if test="criteria.atomName != null">and tad.ATOM_NAME like concat('%'||#{criteria.atomName},'%')</if></where>order by tad.CREATE_DATE desc, auditroute.AUDIT_DATE asc</select>

问题2:使用collection 聚合出现分页问题
xml基础的查询类型和返回类型 里面把注释的

方法返回类型 id = “BaseResultMapBoss” 里

在这里插入图片描述

解决办法1(我最蠢的解决办法,把sql分解)
不知道怎么自定义分页解决这种(不会),
我只能把这一个sql语句分开

在impl层

    @Overridepublic PageResult<AtomDict> queryAllByAuditRouteDuplicate(AtomDictQueryCriteria criteria, Page<Object> page){//        去重 inner join(原来一个sql就该搞定的)
//        IPage<AtomDict> all = atomDictMapper.findAllByAuditRouteNoDuplicate(criteria, page);
//        去重 inner join(分步1)IPage<AtomDict> all = atomDictMapper.findAllByAuditRouteNoDuplicateSubstep(criteria, page);List<AtomDict> records = all.getRecords();//        根据每条数据类的busiSort递归向下查找归属业务分类(回显)
//        每条数据类还要找自己的审批过程(分步2)if(records.size() > 0 ){for (int i = 0; i < records.size(); i++) {AtomDict atomDict = records.get(i);if(atomDict != null){Set<String> taskSetResult  = new LinkedHashSet<>();Long categoryId = atomDict.getCategoryId();
//        			这里拿到第一步去重的审核原子再去查审核记录,放在返回前端的BatchList 里面List<AtomDictAuditRoute> atomDictAuditRoutes = atomDictMapper.selectBath(atomDict.getAtomId());atomDict.setBatchList(atomDictAuditRoutes);if(categoryId != null){List<String> subCategory = atomBusiCategoryMapper.findSubCategory(categoryId);String currentCategoryName = atomBusiCategoryMapper.findCategoryNameByCateforyId(categoryId);taskSetResult.addAll(subCategory);taskSetResult.add(currentCategoryName);String temp = "";for(String item : taskSetResult){temp += ","+item;}String result = temp.substring(1);atomDict.setCategoryName(result);}}}}return PageUtil.toPage(all);}

mapper

    IPage<AtomDict> findAllByAuditRouteNoDuplicateSubstep(@Param("criteria") AtomDictQueryCriteria criteria, Page<Object> page);List<AtomDictAuditRoute> selectBath(@Param("atomId") String atomId);

xml

<!--    关联审核表确定原子已经审核,因为原子审核触发,在原子表没有字段判断是否审核字段修改,才导致要关联审核记录表判断(关键还得去重):和原来区别就是不collection并且去重--><select id="findAllByAuditRouteNoDuplicateSubstep" resultMap="BaseResultMap">select stupid.* from (select row_number() over(partition by tad.ATOM_ID order by tad.CREATE_DATE desc) rn,tatempalte.TEMPLATE_NAME,tabc.CATEGORY_NAME AS CATEGORY_NAME,<include refid="Base_Column_List"/>,<include refid="Dict_Detail_Column_List"/>from T_ATOM_DICT tadleft join T_ATOM_TEMPLATE tatempalte on tatempalte.TEMPLATE_ID = tad.TEMPLATE_IDleft join T_ATOM_BUSI_CATEGORY tabc on tad.CATEGORY_ID = tabc.category_idleft join (select dd.label,dd.value from t_dict d left join t_dict_detail dd on  dd.dict_id = d.dict_idwhere d.name = 'asset_archive_name') dtableon tad.DATABASE = dtable.valueleft join (select dd1.label,dd1.value from t_dict d1 left join t_dict_detail dd1 on  dd1.dict_id = d1.dict_idwhere d1.name = 't_atmo_dict_generation_mechanism') dtable1on tad.DATA_GENE_MODE = dtable1.valueleft join (select dd2.label,dd2.value from t_dict d2 left join t_dict_detail dd2 on  dd2.dict_id = d2.dict_idwhere d2.name = 't_atmo_dict_atomic_library_type') dtable2on tad.LIB_TYPE = dtable2.valueleft join (select dd3.label,dd3.value from t_dict d3 left join t_dict_detail dd3 on  dd3.dict_id = d3.dict_idwhere d3.name = 't_atmo_dict_data_cycle') dtable3on tad.DATA_CYCLE = dtable3.valueleft join (select dd4.label,dd4.value from t_dict d4 left join t_dict_detail dd4 on  dd4.dict_id = d4.dict_idwhere d4.name = 't_atmo_dict_data_type') dtable4on tad.TYPE = dtable4.valueinner join (select ATOM_ID,AUDIT_RESULT,AUDIT_REMARK,ROUTE_ID,AUDIT_ID,AUDIT_DATEfrom T_ATOM_DICT_AUDIT_ROUTE) auditroute on auditroute.ATOM_ID =tad.ATOM_IDleft join t_user tuser on tuser.oper_id = auditroute.AUDIT_ID<where><if test="criteria.atomId != null">and tad.ATOM_ID = #{criteria.atomId}</if><if test="criteria.atomName != null">and tad.ATOM_NAME like concat('%'||#{criteria.atomName},'%')</if></where>) stupidwhere stupid.rn = 1</select><select id="selectBath" resultMap="BatchListResultMap">select <include refid="BathList_Column_List"/>from (select ATOM_ID,AUDIT_RESULT,AUDIT_REMARK,ROUTE_ID,AUDIT_ID,AUDIT_DATEfrom T_ATOM_DICT_AUDIT_ROUTE) auditrouteleft join t_user tuser on tuser.oper_id = auditroute.AUDIT_IDwhere auditroute.ATOM_ID = #{atomId}</select>

解决方法2(设计表时候应该加一个冗余字段)
我仔细想了一下,都是因为T_ATOM_DICT这个原子表缺少一个是否审核字段,(只要触发审核,就修改这个原子是否审核的状态)如果加这个字段就可以直接用collection收集这个原子的审批记录

解决方法3就是我不会的那种,求路过大神指教

http://www.hkea.cn/news/620504/

相关文章:

  • 苹果做安卓游戏下载网站好新媒体营销案例ppt
  • 网络营销实务关键词优化seo优化排名
  • 网站推广优化教程游戏代理加盟平台
  • 网站提升权重全国疫情高峰感染进度
  • 营销型网站怎么做智能建站abc
  • 捷信做单官方网站网络服务主要包括什么
  • 网站建设的方案费用什么时候网络推广
  • 这么做3d展示网站公司百度官网优化
  • 工业设计软件上市公司搜索引擎优化的方法
  • 网站建设公司创意网站网络推广推广
  • 浙江三建建设集团有限公司网站关键词的作用
  • 网站建设官方网站教育培训机构加盟十大排名
  • 万网上传网站seo免费
  • 孝感做网站公司百度热议排名软件
  • 建设网站费用吗廊坊seo快速排名
  • 网站建设公司怎样拓展网站业务大连网站推广
  • 什么网站可以免费做找客户东莞seo建站推广费用
  • 合肥微信网站建设购物网站如何推广
  • 网站建设课程简介图片百度官网认证免费
  • 月夜影视在线观看免费完整版韩剧关键词排名优化报价
  • 做网站的工作时间兰州seo公司
  • css怎么嵌入到html直通车关键词优化口诀
  • 虚拟网站php专业型seo网站关键词排名提升
  • 找人合伙做网站平台b2b电商平台
  • 手机网站建设技术方案找网站设计公司
  • 杭州如何设计公司网站惠州seo网站推广
  • 成都网站建设门户大连企业网站建站模板
  • 游戏卡充值可以做网站吗百度竞价关键词出价技巧
  • 建设企业网站就等于开展网络营销网店推广实训报告
  • dede无法更新网站主页到百度联盟注册