bus_hotwork_sign的mapper创建

pull/4/head
chenxinying 2024-01-17 15:06:25 +08:00
parent ebf1d6d6a0
commit dd05b7d11d
2 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* @author fangjiakai
* @date 2024/01/17 11:31
*/
public interface HotworkSignMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**ID
* @param page
* @throws Exception
*/
List<PageData> listById(Page page);
}

View File

@ -0,0 +1,87 @@
<?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.datasource.eightwork.HotworkSignMapper">
<!--表名 -->
<sql id="tableName">
BUS_HOTWORK_SIGN
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.HOTWORK_SIGN_ID,
f.HOTWORK_ID,
f.CORPINFO_ID,
f.SIGN_USER_DEPARTMENT_ID,
f.SIGN_USER_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.DESCR,
f.STEP_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
HOTWORK_SIGN_ID,
HOTWORK_ID,
CORPINFO_ID,
SIGN_USER_DEPARTMENT_ID,
SIGN_USER_ID,
SIGN_PATH,
SIGN_TIME,
DESCR,
STEP_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{HOTWORK_SIGN_ID},
#{HOTWORK_ID},
#{CORPINFO_ID},
#{SIGN_USER_DEPARTMENT_ID},
#{SIGN_USER_ID},
#{SIGN_PATH},
#{SIGN_TIME},
#{DESCR},
#{STEP_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
DESCR = #{DESCR},
SIGN_PATH = #{SIGN_PATH},
SIGN_TIME= #{SIGN_TIME},
where
HOTWORK_ID = #{HOTWORK_ID} and SIGN_USER_ID = #{SIGN_USER_ID}
</update>
<select id="listById" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.HOTWORK_ID = #{pd.HOTWORK_ID}
order by f.SIGN_TIME desc
</select>
</mapper>