<?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.hzya.frame.sys.thirdparty.api.certification.dao.impl.SysThirdpartyapiCertificationMapperImpl">
	<resultMap id="get-entity-result" type="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		<!--唯一标识码 -->
		<result property="id" column="id" />
		<!--接口id -->
		<result property="thirdpartyApiId" column="thirdparty_api_id" />
		<!--接口 -->
		<result property="apiName" column="api_name" />
		<!--参数名称 -->
		<result property="parameterName" column="parameter_name" />
		<!--是否预警 -->
		<result property="isWarning" column="is_warning" />
		<!--数据类型 -->
		<result property="dataType" column="data_type" />
		<!--数据规范 -->
		<result property="dataSpecification" column="data_specification" />
		<!--是否必填 -->
		<result property="requireds" column="requireds" />
		<!--参数说明 -->
		<result property="parameterDescription" column="parameter_description" />
		<!--参数赋值 -->
		<result property="parameterValue" column="parameter_value" />
		<!--认证参数 -->
		<result property="authenticationParameter" column="authentication_parameter" />
		<!--有效时长 -->
		<result property="effectiveDuration" column="effective_duration" />
		<!--排序号 -->
		<result property="sorts" column="sorts" />
		<!--创建人id -->
		<result property="orgId" column="org_id" />
		<!--状态(Y正常N删除) -->
		<result property="sts" column="sts" />
		<!--创建时间 -->
		<result property="createTime" column="create_time" />
		<!--创建人id -->
		<result property="createUserId" column="create_user_id" />
		<!--修改时间 -->
		<result property="modifyTime" column="modify_time" />
		<!--修改人id -->
		<result property="modifyUserId" column="modify_user_id" />
	</resultMap>

	<sql id="Base_Column_List">
		id,
		thirdparty_api_id,
		api_name,
		parameter_name,
		is_warning,
		data_type,
		data_specification,
		requireds,
		parameter_description,
		parameter_value,
		authentication_parameter,
		effective_duration,
		sorts,
		org_id,
		sts,
		create_time,
		create_user_id,
		modify_time,
		modify_user_id
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-entity-result">
		select
		<include refid="Base_Column_List" />
		from sys_thirdparty_api_certification where id = #{ id } and sts='Y'
	</select>

	<!-- 查询 采用==查询 -->
	<select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		select
		<include refid="Base_Column_List" />
		from sys_thirdparty_api_certification
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> and thirdparty_api_id = #{thirdpartyApiId}</if>
			<if test="apiName != null and apiName !='' "> and api_name = #{apiName}</if>
			<if test="parameterName != null and parameterName !='' "> and parameter_name = #{parameterName}</if>
			<if test="isWarning != null and isWarning !='' "> and is_warning = #{isWarning}</if>
			<if test="dataType != null and dataType !='' "> and data_type = #{dataType}</if>
			<if test="dataSpecification != null and dataSpecification !='' "> and data_specification = #{dataSpecification}</if>
			<if test="requireds != null and requireds !='' "> and requireds = #{requireds}</if>
			<if test="parameterDescription != null and parameterDescription !='' "> and parameter_description = #{parameterDescription}</if>
			<if test="parameterValue != null and parameterValue !='' "> and parameter_value = #{parameterValue}</if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> and authentication_parameter = #{authenticationParameter}</if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> and effective_duration = #{effectiveDuration}</if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="orgId != null and orgId !='' "> and org_id = #{orgId}</if>
			<if test="sts != null and sts !='' "> and sts = #{sts}</if>
			<if test="createTime != null "> and create_time = #{createTime}</if>
			<if test="createUserId != null and createUserId !='' "> and create_user_id = #{createUserId}</if>
			<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
			<if test="modifyUserId != null and modifyUserId !='' "> and modify_user_id = #{modifyUserId}</if>
		</trim>
		<if test=" sort == null or sort =='' "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
	</select>

	<!-- 查询符合条件的数量 -->
	<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		select count(1) from sys_thirdparty_api_certification
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> and thirdparty_api_id = #{thirdpartyApiId}</if>
			<if test="apiName != null and apiName !='' "> and api_name = #{apiName}</if>
			<if test="parameterName != null and parameterName !='' "> and parameter_name = #{parameterName}</if>
			<if test="isWarning != null and isWarning !='' "> and is_warning = #{isWarning}</if>
			<if test="dataType != null and dataType !='' "> and data_type = #{dataType}</if>
			<if test="dataSpecification != null and dataSpecification !='' "> and data_specification = #{dataSpecification}</if>
			<if test="requireds != null and requireds !='' "> and requireds = #{requireds}</if>
			<if test="parameterDescription != null and parameterDescription !='' "> and parameter_description = #{parameterDescription}</if>
			<if test="parameterValue != null and parameterValue !='' "> and parameter_value = #{parameterValue}</if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> and authentication_parameter = #{authenticationParameter}</if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> and effective_duration = #{effectiveDuration}</if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="orgId != null and orgId !='' "> and org_id = #{orgId}</if>
			<if test="sts != null and sts !='' "> and sts = #{sts}</if>
			<if test="createTime != null "> and create_time = #{createTime}</if>
			<if test="createUserId != null and createUserId !='' "> and create_user_id = #{createUserId}</if>
			<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
			<if test="modifyUserId != null and modifyUserId !='' "> and modify_user_id = #{modifyUserId}</if>
		</trim>
	</select>

	<!-- 分页查询列表 采用like格式 -->
	<select id="entity_list_like" resultMap="get-entity-result" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		select
		<include refid="Base_Column_List" />
		from sys_thirdparty_api_certification
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' "> id like concat('%',#{id},'%') </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> and thirdparty_api_id like concat('%',#{thirdpartyApiId},'%') </if>
			<if test="apiName != null and apiName !='' "> and api_name like concat('%',#{apiName},'%') </if>
			<if test="parameterName != null and parameterName !='' "> and parameter_name like concat('%',#{parameterName},'%') </if>
			<if test="isWarning != null and isWarning !='' "> and is_warning like concat('%',#{isWarning},'%') </if>
			<if test="dataType != null and dataType !='' "> and data_type like concat('%',#{dataType},'%') </if>
			<if test="dataSpecification != null and dataSpecification !='' "> and data_specification like concat('%',#{dataSpecification},'%') </if>
			<if test="requireds != null and requireds !='' "> and requireds like concat('%',#{requireds},'%') </if>
			<if test="parameterDescription != null and parameterDescription !='' "> and parameter_description like concat('%',#{parameterDescription},'%') </if>
			<if test="parameterValue != null and parameterValue !='' "> and parameter_value like concat('%',#{parameterValue},'%') </if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> and authentication_parameter like concat('%',#{authenticationParameter},'%') </if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> and effective_duration like concat('%',#{effectiveDuration},'%') </if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="orgId != null and orgId !='' "> and org_id like concat('%',#{orgId},'%') </if>
			<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
			<if test="createTime != null and createTime !='' "> and create_time like concat('%',#{createTime},'%') </if>
			<if test="createUserId != null and createUserId !='' "> and create_user_id like concat('%',#{createUserId},'%') </if>
			<if test="modifyTime != null and modifyTime !='' "> and modify_time like concat('%',#{modifyTime},'%') </if>
			<if test="modifyUserId != null and modifyUserId !='' "> and modify_user_id like concat('%',#{modifyUserId},'%') </if>
		</trim>
		<if test=" sort == null or sort =='' "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>

	<!-- 查询列表 字段采用or格式 -->
	<select id="entity_list_or" resultMap="get-entity-result" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		select
		<include refid="Base_Column_List" />
		from sys_thirdparty_api_certification
		<trim prefix="where" prefixOverrides="or">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> or thirdparty_api_id = #{thirdpartyApiId} </if>
			<if test="apiName != null and apiName !='' "> or api_name = #{apiName} </if>
			<if test="parameterName != null and parameterName !='' "> or parameter_name = #{parameterName} </if>
			<if test="isWarning != null and isWarning !='' "> or is_warning = #{isWarning} </if>
			<if test="dataType != null and dataType !='' "> or data_type = #{dataType} </if>
			<if test="dataSpecification != null and dataSpecification !='' "> or data_specification = #{dataSpecification} </if>
			<if test="requireds != null and requireds !='' "> or requireds = #{requireds} </if>
			<if test="parameterDescription != null and parameterDescription !='' "> or parameter_description = #{parameterDescription} </if>
			<if test="parameterValue != null and parameterValue !='' "> or parameter_value = #{parameterValue} </if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> or authentication_parameter = #{authenticationParameter} </if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> or effective_duration = #{effectiveDuration} </if>
			<if test="sorts != null "> or sorts = #{sorts}</if>
			<if test="orgId != null and orgId !='' "> or org_id = #{orgId} </if>
			<if test="sts != null and sts !='' "> or sts = #{sts} </if>
			<if test="createTime != null and createTime !='' "> or create_time = #{createTime} </if>
			<if test="createUserId != null and createUserId !='' "> or create_user_id = #{createUserId} </if>
			<if test="modifyTime != null and modifyTime !='' "> or modify_time = #{modifyTime} </if>
			<if test="modifyUserId != null and modifyUserId !='' "> or modify_user_id = #{modifyUserId} </if>
		</trim>
		<if test=" sort == null or sort =='' "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>
	<!-- 新增 -->
	<insert id="entity_insert" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		insert into sys_thirdparty_api_certification(
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> id, </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> thirdparty_api_id, </if>
			<if test="apiName != null and apiName !='' "> api_name, </if>
			<if test="parameterName != null and parameterName !='' "> parameter_name, </if>
			<if test="isWarning != null and isWarning !='' "> is_warning, </if>
			<if test="dataType != null and dataType !='' "> data_type, </if>
			<if test="dataSpecification != null and dataSpecification !='' "> data_specification, </if>
			<if test="requireds != null and requireds !='' "> requireds, </if>
			<if test="parameterDescription != null and parameterDescription !='' "> parameter_description, </if>
			<if test="parameterValue != null and parameterValue !='' "> parameter_value, </if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> authentication_parameter, </if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> effective_duration, </if>
			<if test="sorts != null ">sorts,</if>
			<if test="orgId != null and orgId !='' "> org_id, </if>
			<if test="sts != null and sts !='' "> sts, </if>
			<if test="createTime != null ">create_time,</if>
			<if test="createUserId != null and createUserId !='' "> create_user_id, </if>
			<if test="modifyTime != null ">modify_time,</if>
			<if test="modifyUserId != null and modifyUserId !='' "> modify_user_id, </if>
		</trim>
		)values
		(
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> #{id}, </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> #{thirdpartyApiId}, </if>
			<if test="apiName != null and apiName !='' "> #{apiName}, </if>
			<if test="parameterName != null and parameterName !='' "> #{parameterName}, </if>
			<if test="isWarning != null and isWarning !='' "> #{isWarning}, </if>
			<if test="dataType != null and dataType !='' "> #{dataType}, </if>
			<if test="dataSpecification != null and dataSpecification !='' "> #{dataSpecification}, </if>
			<if test="requireds != null and requireds !='' "> #{requireds}, </if>
			<if test="parameterDescription != null and parameterDescription !='' "> #{parameterDescription}, </if>
			<if test="parameterValue != null and parameterValue !='' "> #{parameterValue}, </if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> #{authenticationParameter}, </if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> #{effectiveDuration}, </if>
			<if test="sorts != null ">#{sorts},</if>
			<if test="orgId != null and orgId !='' "> #{orgId}, </if>
			<if test="sts != null and sts !='' "> #{sts}, </if>
			<if test="createTime != null ">#{createTime},</if>
			<if test="createUserId != null and createUserId !='' "> #{createUserId}, </if>
			<if test="modifyTime != null ">#{modifyTime},</if>
			<if test="modifyUserId != null and modifyUserId !='' "> #{modifyUserId}, </if>
		</trim>
		)
	</insert>

	<!-- 修改 -->
	<update id="entity_update" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		update sys_thirdparty_api_certification set
		<trim suffix="" suffixOverrides=",">
				<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> thirdparty_api_id = #{thirdpartyApiId},</if>
				<if test="apiName != null and apiName !='' "> api_name = #{apiName},</if>
				<if test="parameterName != null and parameterName !='' "> parameter_name = #{parameterName},</if>
				<if test="isWarning != null and isWarning !='' "> is_warning = #{isWarning},</if>
				<if test="dataType != null and dataType !='' "> data_type = #{dataType},</if>
				<if test="dataSpecification != null and dataSpecification !='' "> data_specification = #{dataSpecification},</if>
				<if test="requireds != null and requireds !='' "> requireds = #{requireds},</if>
				<if test="parameterDescription != null and parameterDescription !='' "> parameter_description = #{parameterDescription},</if>
				<if test="parameterValue != null and parameterValue !='' "> parameter_value = #{parameterValue},</if>
				<if test="authenticationParameter != null and authenticationParameter !='' "> authentication_parameter = #{authenticationParameter},</if>
				<if test="effectiveDuration != null and effectiveDuration !='' "> effective_duration = #{effectiveDuration},</if>
				<if test="sorts != null ">sorts = #{sorts},</if>
				<if test="orgId != null and orgId !='' "> org_id = #{orgId},</if>
				<if test="sts != null and sts !='' "> sts = #{sts},</if>
				<if test="createTime != null ">create_time = #{createTime},</if>
				<if test="createUserId != null and createUserId !='' "> create_user_id = #{createUserId},</if>
				<if test="modifyTime != null ">modify_time = #{modifyTime},</if>
				<if test="modifyUserId != null and modifyUserId !='' "> modify_user_id = #{modifyUserId},</if>
		</trim>
		where id = #{id}
	</update>

	<!-- 逻辑删除 -->
	<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		update sys_thirdparty_api_certification set
		sts='N',modify_time = now(),modify_user_id = #{modifyUserId} where
		id = #{id}
	</update>

	<!-- 逻辑删除多条件 -->
	<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		update sys_thirdparty_api_certification set
		sts='N',modify_time = now(),modify_user_id = #{modifyUserId}
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="thirdpartyApiId != null and thirdpartyApiId !='' "> and thirdparty_api_id = #{thirdpartyApiId}</if>
			<if test="apiName != null and apiName !='' "> and api_name = #{apiName}</if>
			<if test="parameterName != null and parameterName !='' "> and parameter_name = #{parameterName}</if>
			<if test="isWarning != null and isWarning !='' "> and is_warning = #{isWarning}</if>
			<if test="dataType != null and dataType !='' "> and data_type = #{dataType}</if>
			<if test="dataSpecification != null and dataSpecification !='' "> and data_specification = #{dataSpecification}</if>
			<if test="requireds != null and requireds !='' "> and requireds = #{requireds}</if>
			<if test="parameterDescription != null and parameterDescription !='' "> and parameter_description = #{parameterDescription}</if>
			<if test="parameterValue != null and parameterValue !='' "> and parameter_value = #{parameterValue}</if>
			<if test="authenticationParameter != null and authenticationParameter !='' "> and authentication_parameter = #{authenticationParameter}</if>
			<if test="effectiveDuration != null and effectiveDuration !='' "> and effective_duration = #{effectiveDuration}</if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="orgId != null and orgId !='' "> and org_id = #{orgId}</if>
			<if test="sts != null and sts !='' "> and sts = #{sts}</if>
			<if test="createTime != null and createTime !='' "> and create_time = #{createTime}</if>
			<if test="createUserId != null and createUserId !='' "> and create_user_id = #{createUserId}</if>
		</trim>
	</update>

	<!-- 物理删除 -->
	<delete id="entity_delete" parameterType="com.hzya.frame.sys.thirdparty.api.certification.entity.SysThirdpartyapiCertification">
		delete from sys_thirdparty_api_certification where id =#{id}
	</delete>

	<!-- 逻辑删除多条件 -->
	<update id="delect_by_ThirdpartyApiId" parameterType="java.lang.String">
		update sys_thirdparty_api_certification set
		sts='N',modify_time = now()
		WHERE thirdparty_api_id in
		<foreach item="ids" collection="list" open="(" separator="," close=")">
			#{ids}
		</foreach>
	</update>
</mapper>
