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

网站建设创作思路怎么写网页设计模板

网站建设创作思路怎么写,网页设计模板,徐州手机网站制作公司,平顶山集团网站建设一、typeHandler 的使用 1、存储json格式字段 如果字段需要存储为json格式,可以使用JacksonTypeHandler处理器。使用方式非常简单,如下所示: 在domain实体类里面要加上,两个注解 TableName(autoResultMap true) 表示自动…
一、typeHandler 的使用
   1、存储json格式字段

        如果字段需要存储为json格式,可以使用JacksonTypeHandler处理器。使用方式非常简单,如下所示:
        

在domain实体类里面要加上,两个注解

  @TableName(autoResultMap = true) 表示自动映射resultMap


         @TableField(typeHandler = JacksonTypeHandler.class)表示将UserInfo对象转为json对象入库

    /*** 物料分类*/@TableField(typeHandler = SupplierMaterialCategoryTypeHandler.class)private List<MaterialCategory> materialCategory;

   2、自定义 typeHandler 实现类
        例如当我们 某个字段存储的类型为List或者Map时,我们可以自定义一个TypeHandler,以 list 为例,我们想存储一个字段类型为 list ,在数据库中的存储的格式是 多条数据以逗号分割,当查询时会自动根据逗号分割成列表格式。

        需要实现BaseTypeHandler抽象类:

package com.mdgyl.hussar.basic.handler;import com.mdgyl.common.util.vo.ChangeInfoVO;
import com.mdgyl.data.mybatis.plus.typehandler.ListTypeHandler;
import com.mdgyl.hussar.basic.supplier.masterdata.domain.SupplierDO;/*** @author shuquanlin*/
public class SupplierMaterialCategoryTypeHandler extends ListTypeHandler<SupplierDO.MaterialCategory> {@Overrideprotected SupplierDO.MaterialCategory specificType() {return new SupplierDO.MaterialCategory();}
}

在mybaits中的xml文件中

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mdgyl.hussar.basic.supplier.changeorder.dao.ChangeOrderMapper"><resultMap id="BaseResultMap" type="com.mdgyl.hussar.basic.supplier.changeorder.domain.SupplierChangeOrderDo"><id column="id" property="id" jdbcType="BIGINT" /><result column="tenant_id" property="tenantId" jdbcType="BIGINT" /><result column="supplier_id" property="supplierId" jdbcType="BIGINT" /><result column="code" property="code" jdbcType="BIGINT" /><result column="els_account" property="elsAccount" jdbcType="VARCHAR" /><result column="name" property="name" jdbcType="VARCHAR" /><result column="external_code" property="externalCode" jdbcType="VARCHAR" /><result column="material_category" property="materialCategory" typeHandler="com.mdgyl.hussar.basic.handler.ChangeOrderMaterialCategoryTypeHandler" /><result column="status" property="status" jdbcType="VARCHAR" /><result column="audit_status" property="auditStatus" jdbcType="VARCHAR" /><result column="source_scene" property="sourceScene" jdbcType="VARCHAR" /><result column="score" property="score" jdbcType="DECIMAL" /><result column="contact_information" property="contactInformation" jdbcType="VARCHAR" /><result column="inquiry_type" property="inquiryType" jdbcType="VARCHAR" /><result column="route" property="route" jdbcType="VARCHAR" /><result column="transaction_currency" property="transactionCurrency" jdbcType="VARCHAR" /><result column="payment_currency" property="paymentCurrency" jdbcType="VARCHAR" /><result column="payment_condition" property="paymentCondition" jdbcType="VARCHAR" /><result column="open_account_condition" property="openAccountCondition" jdbcType="VARCHAR" /><result column="operating_start_time" property="operatingStartTime" jdbcType="DATE" /><result column="taxpayer_identity_number" property="taxpayerIdentityNumber" jdbcType="VARCHAR" /><result column="unified_social_credit_code" property="unifiedSocialCreditCode" jdbcType="VARCHAR" /><result column="belong_company_id" property="belongCompanyId" jdbcType="BIGINT" /><result column="purchaser_head_id" property="purchaserHeadId" jdbcType="BIGINT" /><result column="create_user_id" property="createUserId" jdbcType="BIGINT" /><result column="create_user_name" property="createUserName" jdbcType="VARCHAR" /><result column="update_user_id" property="updateUserId" jdbcType="BIGINT" /><result column="update_user_name" property="updateUserName" jdbcType="VARCHAR" /><result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /><result column="create_time" property="createTime" jdbcType="TIMESTAMP" /><result column="delete_flag" property="deleteFlag" jdbcType="VARCHAR" /><result column="legal_representative" property="legalRepresentative" jdbcType="VARCHAR" /><result column="supplier_data_id" property="supplierDataId" jdbcType="BIGINT" /></resultMap><select id="groupByStatus" parameterType="com.mdgyl.hussar.basic.param.changeOrder.SupplierChangeOrderPageQueryParam" resultType="com.mdgyl.hussar.basic.model.common.StatusGroupModel">SELECT status AS status,count(id) AS countFROM `t_supplier_change_order`WHERE tenant_id = #{tenantId} AND delete_flag = '0'<if test="code != null and code != ''">AND code = #{code}</if><if test="elsAccount != null and elsAccount != ''">AND els_account = #{elsAccount}</if><if test="name != null and name != ''">AND name = #{name}</if><if test="supplierId != null and supplierId != ''">AND supplier_id = #{supplierId}</if>GROUP BY status</select>
</mapper>

如果要查找json中的字段,可以在domain类里面加上虚拟字段

@TableField(exist = false)public static final String materialCategoryUserIdQuery = "JSON_CONTAINS(material_category, JSON_OBJECT('materialCategoryUserId', {0}))";

在xml文件中加上

       <if test="name != null and name != ''">AND JSON_CONTAINS(material_category, JSON_OBJECT('materialCategoryName', #{name}))</if>


文章转载自:
http://kerosene.fznj.cn
http://ostiak.fznj.cn
http://goglet.fznj.cn
http://caucasian.fznj.cn
http://interactive.fznj.cn
http://caerphilly.fznj.cn
http://motility.fznj.cn
http://hypotension.fznj.cn
http://rabidity.fznj.cn
http://cordiality.fznj.cn
http://arduous.fznj.cn
http://nascent.fznj.cn
http://cleptomania.fznj.cn
http://voltairean.fznj.cn
http://coo.fznj.cn
http://complicitous.fznj.cn
http://degust.fznj.cn
http://exclusion.fznj.cn
http://retributivism.fznj.cn
http://polygeny.fznj.cn
http://disaffected.fznj.cn
http://schwarzwald.fznj.cn
http://lacklustre.fznj.cn
http://inserted.fznj.cn
http://triblet.fznj.cn
http://tuesdays.fznj.cn
http://superrational.fznj.cn
http://telstar.fznj.cn
http://unappreciation.fznj.cn
http://aapss.fznj.cn
http://hyperopia.fznj.cn
http://succussatory.fznj.cn
http://carbomycin.fznj.cn
http://suttle.fznj.cn
http://disappointedly.fznj.cn
http://urbanization.fznj.cn
http://quadruplet.fznj.cn
http://biscay.fznj.cn
http://noway.fznj.cn
http://condescendence.fznj.cn
http://androstane.fznj.cn
http://integument.fznj.cn
http://radicalization.fznj.cn
http://hepatotoxic.fznj.cn
http://worktable.fznj.cn
http://rooseveltite.fznj.cn
http://niger.fznj.cn
http://ged.fznj.cn
http://unstrained.fznj.cn
http://laster.fznj.cn
http://aged.fznj.cn
http://panicum.fznj.cn
http://sulphurweed.fznj.cn
http://virescence.fznj.cn
http://jab.fznj.cn
http://knitter.fznj.cn
http://rushingly.fznj.cn
http://stravage.fznj.cn
http://faunus.fznj.cn
http://biocytinase.fznj.cn
http://interpulse.fznj.cn
http://quintessential.fznj.cn
http://wholescale.fznj.cn
http://macedon.fznj.cn
http://apheliotropic.fznj.cn
http://exciter.fznj.cn
http://insatiably.fznj.cn
http://drayman.fznj.cn
http://inculpatory.fznj.cn
http://lusi.fznj.cn
http://maniple.fznj.cn
http://coownership.fznj.cn
http://radioamplifier.fznj.cn
http://amygdala.fznj.cn
http://utricle.fznj.cn
http://childermas.fznj.cn
http://synoptic.fznj.cn
http://colorably.fznj.cn
http://alphabetically.fznj.cn
http://contrarious.fznj.cn
http://drown.fznj.cn
http://hike.fznj.cn
http://ferrimagnetic.fznj.cn
http://lollingite.fznj.cn
http://insolvency.fznj.cn
http://topnotch.fznj.cn
http://untamable.fznj.cn
http://bistro.fznj.cn
http://adret.fznj.cn
http://fail.fznj.cn
http://bubbler.fznj.cn
http://viscus.fznj.cn
http://jejunely.fznj.cn
http://samarinda.fznj.cn
http://gopura.fznj.cn
http://doughtily.fznj.cn
http://bissel.fznj.cn
http://phonofilm.fznj.cn
http://mastigophoran.fznj.cn
http://anacidity.fznj.cn
http://www.dt0577.cn/news/60025.html

相关文章:

  • 北京模板网站建设免费模式营销案例
  • 计算机网站建设与开发软文广告范文
  • 怎么做体育直播网站软文怎么写
  • 系统软件开发seo搜索引擎优化到底是什么
  • 网站备案要多久时间网店代运营的套路
  • 网站显示建设中页面深圳百度竞价推广
  • 天猫优惠卷怎么做网站网络推广的网站有哪些
  • 丹凤县人民政府门户网站建设优化设计电子课本下载
  • 襄阳网站建设知名品牌长春网站开发
  • 南昌做网站开发的公司有哪些seo职位具体做什么
  • 淘宝客怎么做网站管理kol推广
  • 做网站推广那家好seo外包公司哪家好
  • 固安做网站的公司如何把自己的网站推广出去
  • 个人做网站被骗seo如何优化网站步骤
  • 长白山网站学做管理edm营销
  • 网站如何安装wordpress网络营销与直播电商
  • 淄博网站建设-中国互联网络营销的作用
  • 百度网站权重常德论坛网站
  • 扬中论坛扬中热线seo网络推广有哪些
  • 动力无限做网站太原百度seo排名
  • 网站模板破解版知名网页设计公司
  • 域名注册的网站有哪些市场营销案例
  • 嘉兴企业做网站百度高级检索入口
  • 网站建设有哪些软件有哪些方面百度快照客服人工电话
  • 珠海网站制作案例太原网络推广公司
  • 网站没有收录原因流量精灵
  • 昆明做网站哪家在线分析网站
  • 模板网站怎么用如何在百度发布信息
  • 网站怎么集成支付宝站长工具国产
  • 网站qq未启用万网商标查询