<?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.dsno2.depository.LibraryLogMapper">

	<!--表名 -->
	<sql id="tableName">
		BUS_LIBRARY_LOG
	</sql>

	<!--数据字典表名 -->
	<sql id="dicTableName">
		SYS_DICTIONARIES
	</sql>

	<!-- 字段 -->
	<sql id="Field">
		f.LIBRARY_LOG_ID,
		f.PATH,
		f.CREATOR,
		f.CREATOR_NAME,
		f.CREATE_TIME,
		f.BUS_TEXT_LIBRARY_ID
	</sql>

	<sql id="Field2">
		LIBRARY_LOG_ID,
		PATH,
		CREATOR,
		CREATOR_NAME,
		CREATE_TIME,
		BUS_TEXT_LIBRARY_ID
	</sql>

	<sql id="FieldValue">
		#{LIBRARY_LOG_ID},
		#{PATH},
		#{CREATOR},
		#{CREATOR_NAME},
		#{CREATE_TIME},
		#{BUS_TEXT_LIBRARY_ID}
	</sql>

	<!-- 新增-->
	<insert id="save" parameterType="pd">
		insert into
		<include refid="tableName"></include>
		(
		<include refid="Field2"></include>
		) values (
		<include refid="FieldValue"></include>
		)
	</insert>

	<select id="findById" parameterType="pd" resultType="pd">
		select
		<include refid="Field"></include>
		from
		<include refid="tableName"></include> f
		where
		f.LIBRARY_LOG_ID = #{LIBRARY_LOG_ID}
	</select>

	<select id="findByLogId" parameterType="pd" resultType="pd">
		select
		<include refid="Field"></include>
		from
		<include refid="tableName"></include> f
		where
		f.BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
		order by f.CREATE_TIME desc
	</select>

</mapper>
