提交本地工具模块相关代码

This commit is contained in:
duanwenbin
2021-07-07 11:21:42 +08:00
parent 1ea0d09cb0
commit 9709acf0a9
69 changed files with 11150 additions and 1 deletions
@@ -0,0 +1,245 @@
<?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.adc.da.ocr.dao.OcrRecordEODao" >
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.ocr.entity.OcrRecordEO" >
<id column="id" property="id" />
<result column="word_file_code" property="wordFileCode" />
<result column="json_file_code" property="jsonFileCode" />
<result column="doc_real_name" property="docRealName" />
<result column="json_real_name" property="jsonRealName" />
<result column="file_name" property="fileName" />
<result column="doc_name" property="docName" />
<result column="json_name" property="jsonName" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
<result column="result_content" property="resultContent" />
<result column="file_type" property="fileType" />
<result column="stand_number" property="standNumber" />
<result column="stand_name" property="standName" />
</resultMap>
<!-- OCR_RECORD table all fields -->
<sql id="Base_Column_List" >
word_file_code, json_file_code, id, doc_real_name, json_real_name, file_name, doc_name, json_name,
creation_time, modify_time,result_content,file_type,stand_number,stand_name
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="wordFileCode != null" >
and word_file_code ${wordFileCodeOperator} #{wordFileCode}
</if>
<if test="jsonFileCode != null" >
and json_file_code ${jsonFileCodeOperator} #{jsonFileCode}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="docRealName != null" >
and doc_real_name ${docRealNameOperator} #{docRealName}
</if>
<if test="jsonRealName != null" >
and json_real_name ${jsonRealNameOperator} #{jsonRealName}
</if>
<if test="fileName != null" >
and file_name ${fileNameOperator} #{fileName}
</if>
<if test="docName != null" >
and doc_name ${docNameOperator} #{docName}
</if>
<if test="jsonName != null" >
and json_name ${jsonNameOperator} #{jsonName}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.ocr.entity.OcrRecordEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_OCR_RECORD.NEXTVAL FROM DUAL
</selectKey> -->
insert into OCR_RECORD(<include refid="Base_Column_List" />)
values (#{wordFileCode, jdbcType=VARCHAR}, #{jsonFileCode, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{docRealName, jdbcType=VARCHAR}, #{jsonRealName, jdbcType=VARCHAR}, #{fileName, jdbcType=VARCHAR}, #{docName, jdbcType=VARCHAR}, #{jsonName, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.ocr.entity.OcrRecordEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_OCR_RECORD.NEXTVAL FROM DUAL
</selectKey> -->
insert into OCR_RECORD
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="wordFileCode != null" >word_file_code,</if>
<if test="jsonFileCode != null" >json_file_code,</if>
<if test="id != null" >id,</if>
<if test="docRealName != null" >doc_real_name,</if>
<if test="jsonRealName != null" >json_real_name,</if>
<if test="fileName != null" >file_name,</if>
<if test="docName != null" >doc_name,</if>
<if test="jsonName != null" >json_name,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="resultContent != null" >result_content,</if>
<if test="fileType != null" >file_type,</if>
<if test="standNumber != null" >stand_number,</if>
<if test="standName != null" >stand_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="wordFileCode != null" >#{wordFileCode, jdbcType=VARCHAR},</if>
<if test="jsonFileCode != null" >#{jsonFileCode, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="docRealName != null" >#{docRealName, jdbcType=VARCHAR},</if>
<if test="jsonRealName != null" >#{jsonRealName, jdbcType=VARCHAR},</if>
<if test="fileName != null" >#{fileName, jdbcType=VARCHAR},</if>
<if test="docName != null" >#{docName, jdbcType=VARCHAR},</if>
<if test="jsonName != null" >#{jsonName, jdbcType=VARCHAR},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="resultContent != null" >#{resultContent, jdbcType=VARCHAR},</if>
<if test="fileType != null" >#{fileType, jdbcType=VARCHAR},</if>
<if test="standNumber != null" >#{standNumber, jdbcType=VARCHAR},</if>
<if test="standName != null" >#{standName, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.ocr.entity.OcrRecordEO" >
update OCR_RECORD
set word_file_code = #{wordFileCode},
json_file_code = #{jsonFileCode},
doc_real_name = #{docRealName},
json_real_name = #{jsonRealName},
file_name = #{fileName},
doc_name = #{docName},
json_name = #{jsonName},
creation_time = #{creationTime},
modify_time = #{modifyTime}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.ocr.entity.OcrRecordEO" >
update OCR_RECORD
<set >
<if test="wordFileCode != null" >
word_file_code = #{wordFileCode},
</if>
<if test="jsonFileCode != null" >
json_file_code = #{jsonFileCode},
</if>
<if test="docRealName != null" >
doc_real_name = #{docRealName},
</if>
<if test="jsonRealName != null" >
json_real_name = #{jsonRealName},
</if>
<if test="fileName != null" >
file_name = #{fileName},
</if>
<if test="docName != null" >
doc_name = #{docName},
</if>
<if test="jsonName != null" >
json_name = #{jsonName},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="resultContent != null" >
result_content = #{resultContent},
</if>
<if test="fileType != null" >
file_type = #{fileType},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
<if test="standName != null" >
stand_name = #{standName},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 OCR_RECORD -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from OCR_RECORD
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from OCR_RECORD
where id = #{value}
</delete>
<!-- OCR_RECORD 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from OCR_RECORD
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询OCR_RECORD列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" />,(UNIX_TIMESTAMP(modify_time)-UNIX_TIMESTAMP(creation_time)) as spendTime from
(select tmp_tb.* from
(select <include refid="Base_Column_List" />,(UNIX_TIMESTAMP(modify_time)-UNIX_TIMESTAMP(creation_time)) as spendTime from OCR_RECORD
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
<if test="sql != null">
ORDER BY ${sql}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from OCR_RECORD
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<select id="getAllOcrResult" resultMap="BaseResultMap" >
select id, doc_real_name, json_real_name, file_name, doc_name, json_name, creation_time, modify_time,file_type,stand_number,stand_name
from OCR_RECORD ORDER BY creation_time DESC
</select>
<delete id="deleteByIds" parameterType="java.lang.String">
delete from OCR_RECORD
where id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>