20 changed files with 104 additions and 3845 deletions
-
11mdp-form/src/main/java/com/mdp/form/ctrl/FormDataController.java
-
53mdp-form/src/main/java/com/mdp/form/ctrl/FormDataTagController.java
-
23mdp-form/src/main/java/com/mdp/form/ctrl/FormDefController.java
-
6mdp-form/src/main/java/com/mdp/form/service/FormDataService.java
-
389mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormDataMapper.xml
-
216mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormDataProcessApprovaMapper.xml
-
176mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormDataTagMapper.xml
-
245mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormDefMapper.xml
-
158mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormDefTagMapper.xml
-
240mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormFieldMapper.xml
-
204mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormQxMapper.xml
-
172mdp-form/src/main/resources/mybatis/mapper/mdp/form/dao/FormViewMapper.xml
-
49mdp-form/src/main/resources/mybatis/mybatis-config.xml
-
283mdp-form/src/test/java/com/mdp/form/service/TestFormDataProcessApprovaService.java
-
279mdp-form/src/test/java/com/mdp/form/service/TestFormDataService.java
-
279mdp-form/src/test/java/com/mdp/form/service/TestFormDataTagService.java
-
283mdp-form/src/test/java/com/mdp/form/service/TestFormDefService.java
-
279mdp-form/src/test/java/com/mdp/form/service/TestFormDefTagService.java
-
283mdp-form/src/test/java/com/mdp/form/service/TestFormFieldService.java
-
279mdp-form/src/test/java/com/mdp/form/service/TestFormQxService.java
@ -1,389 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormData"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" ids != null"> and (res.id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" cuserids !=null"> and res.cuserid in |
|
||||
<foreach collection="cuserids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" flowStates !=null"> and res.flow_state in |
|
||||
<foreach collection="flowStates" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" deptids !=null"> and res.deptid in |
|
||||
<foreach collection="deptids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=' fromStartTime !=null and toStartTime != null '> and res.create_time between #{fromStartTime} and #{toStartTime}</if> |
|
||||
<if test=" cuserids !=null"> and res.cuserid in |
|
||||
<foreach collection="cuserids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" userids !=null"> and res.userid in |
|
||||
<foreach collection="userids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" tagIds !=null"> and exists ( select 1 from form.form_data_tag tag where tag.data_id = res.id and tag.tag_id in |
|
||||
<foreach collection="tagIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> ) |
|
||||
</if> |
|
||||
<if test="procInstId!=null and procInstId!=''">and exists(select 1 from form.form_data_process_approva app where app.proc_inst_id=#{procInstId} and res.id=app.form_data_id )</if> |
|
||||
</sql> |
|
||||
|
|
||||
|
|
||||
<select id="getDbFormDataByBizKey" parameterType="String" resultType="com.mdp.form.entity.FormData"> |
|
||||
select * from form_data res |
|
||||
where res.biz_key = #{bizKey} |
|
||||
</select> |
|
||||
<update id="updateTagsById" parameterType="HashMap"> |
|
||||
update form_data |
|
||||
set tag_ids=#{tagIds},tag_names=#{tagNames} where id=#{id} |
|
||||
</update> |
|
||||
<select id="countByFormId" parameterType="HashMap" resultType="long"> |
|
||||
select count(1) from form_data res where res.form_id=#{formId} |
|
||||
</select> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdateWithoutFlowState" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_data set |
|
||||
two = #{item.two}, |
|
||||
three = #{item.three}, |
|
||||
four = #{item.four}, |
|
||||
five = #{item.five}, |
|
||||
six = #{item.six}, |
|
||||
seven = #{item.seven}, |
|
||||
eight = #{item.eight}, |
|
||||
nine = #{item.nine}, |
|
||||
ten = #{item.ten}, |
|
||||
last_time = #{item.lastTime}, |
|
||||
one = #{item.one}, |
|
||||
zero = #{item.zero}, |
|
||||
remark = #{item.remark}, |
|
||||
form_id = #{item.formId}, |
|
||||
userid = #{item.userid}, |
|
||||
eleven = #{item.eleven}, |
|
||||
twelve = #{item.twelve}, |
|
||||
thirteen = #{item.thirteen}, |
|
||||
fourteen = #{item.fourteen}, |
|
||||
fifteen = #{item.fifteen}, |
|
||||
attachment_urls = #{item.attachmentUrls}, |
|
||||
attachment_names = #{item.attachmentNames}, |
|
||||
branch_id = #{item.branchId}, |
|
||||
biz_key = #{item.bizKey}, |
|
||||
deptid = #{item.deptid}, |
|
||||
create_time = #{item.createTime}, |
|
||||
dqx_code = #{item.dqxCode}, |
|
||||
cuserid = #{item.cuserid}, |
|
||||
tag_ids = #{item.tagIds}, |
|
||||
tag_names = #{item.tagNames}, |
|
||||
cusername = #{item.cusername}, |
|
||||
dept_name = #{item.deptName} |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateFlowStateByProcInst" parameterType="HashMap"> |
|
||||
update form_data res,form_data_process_approva app set res.flow_state=#{flowState},res.last_time=now(),app.flow_state=#{flowState},app.flow_last_time=now() |
|
||||
<if test=' flowState=="3" or flowState=="4" or flowState=="2"'>,app.end_time=now()</if> |
|
||||
where res.form_id=#{formId} and app.form_data_id=res.id and app.proc_inst_id=#{procInstId} |
|
||||
</update> |
|
||||
|
|
||||
<update id="updateSomeFieldsByProcInstId" parameterType="HashMap"> |
|
||||
update form_data res |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where EXISTS ( SELECT 1 FROM form_data_process_approva a where a.proc_inst_id = #{procInstId} AND a.form_data_id = res.id ) |
|
||||
</update> |
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_data res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormData" resultType="com.mdp.form.entity.FormData"> |
|
||||
select * from form_data res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormData" resultType="com.mdp.form.entity.FormData"> |
|
||||
select * from form_data res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormData"> |
|
||||
select * from form_data res |
|
||||
where (res.id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_data res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormData" resultType="long"> |
|
||||
select count(*) from form_data res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormData" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into form_data( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{id},#{two},#{three},#{four},#{five},#{six},#{seven},#{eight},#{nine},#{ten},#{lastTime},#{one},#{zero},#{remark},#{formId},#{userid},#{eleven},#{twelve},#{thirteen},#{fourteen},#{fifteen},#{attachmentUrls},#{attachmentNames},#{branchId},#{bizKey},#{deptid},#{flowState},#{createTime},#{dqxCode},#{cuserid},#{tagIds},#{tagNames},#{cusername},#{deptName} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormData"> |
|
||||
delete from form_data res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormData"> |
|
||||
delete from form_data |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormData"> |
|
||||
update form_data |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormData"> |
|
||||
update form_data |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_data |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_data |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_data |
|
||||
where |
|
||||
(id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.id} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
id,two,three,four,five,six,seven,eight,nine,ten,last_time,one,zero,remark,form_id,userid,eleven,twelve,thirteen,fourteen,fifteen,attachment_urls,attachment_names,branch_id,biz_key,deptid,flow_state,create_time,dqx_code,cuserid,tag_ids,tag_names,cusername,dept_name |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="two != null and two != ''"> and res.two = #{two} </if> |
|
||||
<if test="three != null and three != ''"> and res.three = #{three} </if> |
|
||||
<if test="four != null and four != ''"> and res.four = #{four} </if> |
|
||||
<if test="five != null and five != ''"> and res.five = #{five} </if> |
|
||||
<if test="six != null and six != ''"> and res.six = #{six} </if> |
|
||||
<if test="seven != null and seven != ''"> and res.seven = #{seven} </if> |
|
||||
<if test="eight != null and eight != ''"> and res.eight = #{eight} </if> |
|
||||
<if test="nine != null and nine != ''"> and res.nine = #{nine} </if> |
|
||||
<if test="ten != null and ten != ''"> and res.ten = #{ten} </if> |
|
||||
<if test="lastTime != null"> and date_format(res.last_time,'%Y-%m-%d') = date_format(#{lastTime},'%Y-%m-%d') </if> |
|
||||
<if test="one != null and one != ''"> and res.one = #{one} </if> |
|
||||
<if test="zero != null and zero != ''"> and res.zero = #{zero} </if> |
|
||||
<if test="remark != null and remark != ''"> and res.remark = #{remark} </if> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> |
|
||||
<if test="eleven != null and eleven != ''"> and res.eleven = #{eleven} </if> |
|
||||
<if test="twelve != null and twelve != ''"> and res.twelve = #{twelve} </if> |
|
||||
<if test="thirteen != null and thirteen != ''"> and res.thirteen = #{thirteen} </if> |
|
||||
<if test="fourteen != null and fourteen != ''"> and res.fourteen = #{fourteen} </if> |
|
||||
<if test="fifteen != null and fifteen != ''"> and res.fifteen = #{fifteen} </if> |
|
||||
<if test="attachmentUrls != null and attachmentUrls != ''"> and res.attachment_urls = #{attachmentUrls} </if> |
|
||||
<if test="attachmentNames != null and attachmentNames != ''"> and res.attachment_names = #{attachmentNames} </if> |
|
||||
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if> |
|
||||
<if test="bizKey != null and bizKey != ''"> and res.biz_key = #{bizKey} </if> |
|
||||
<if test="deptid != null and deptid != ''"> and res.deptid = #{deptid} </if> |
|
||||
<if test="flowState != null and flowState != ''"> and res.flow_state = #{flowState} </if> |
|
||||
<if test="createTime != null"> and date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </if> |
|
||||
<if test="dqxCode != null and dqxCode != ''"> and res.dqx_code = #{dqxCode} </if> |
|
||||
<if test="cuserid != null and cuserid != ''"> and res.cuserid = #{cuserid} </if> |
|
||||
<if test="tagIds != null and tagIds != ''"> and res.tag_ids = #{tagIds} </if> |
|
||||
<if test="tagNames != null and tagNames != ''"> and res.tag_names = #{tagNames} </if> |
|
||||
<if test="cusername != null and cusername != ''"> and res.cusername = #{cusername} </if> |
|
||||
<if test="deptName != null and deptName != ''"> and res.dept_name = #{deptName} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
two = #{two}, |
|
||||
three = #{three}, |
|
||||
four = #{four}, |
|
||||
five = #{five}, |
|
||||
six = #{six}, |
|
||||
seven = #{seven}, |
|
||||
eight = #{eight}, |
|
||||
nine = #{nine}, |
|
||||
ten = #{ten}, |
|
||||
last_time = #{lastTime}, |
|
||||
one = #{one}, |
|
||||
zero = #{zero}, |
|
||||
remark = #{remark}, |
|
||||
form_id = #{formId}, |
|
||||
userid = #{userid}, |
|
||||
eleven = #{eleven}, |
|
||||
twelve = #{twelve}, |
|
||||
thirteen = #{thirteen}, |
|
||||
fourteen = #{fourteen}, |
|
||||
fifteen = #{fifteen}, |
|
||||
attachment_urls = #{attachmentUrls}, |
|
||||
attachment_names = #{attachmentNames}, |
|
||||
branch_id = #{branchId}, |
|
||||
biz_key = #{bizKey}, |
|
||||
deptid = #{deptid}, |
|
||||
flow_state = #{flowState}, |
|
||||
create_time = #{createTime}, |
|
||||
dqx_code = #{dqxCode}, |
|
||||
cuserid = #{cuserid}, |
|
||||
tag_ids = #{tagIds}, |
|
||||
tag_names = #{tagNames}, |
|
||||
cusername = #{cusername}, |
|
||||
dept_name = #{deptName} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="two != null and two != ''"> two = #{two}, </if> |
|
||||
<if test="three != null and three != ''"> three = #{three}, </if> |
|
||||
<if test="four != null and four != ''"> four = #{four}, </if> |
|
||||
<if test="five != null and five != ''"> five = #{five}, </if> |
|
||||
<if test="six != null and six != ''"> six = #{six}, </if> |
|
||||
<if test="seven != null and seven != ''"> seven = #{seven}, </if> |
|
||||
<if test="eight != null and eight != ''"> eight = #{eight}, </if> |
|
||||
<if test="nine != null and nine != ''"> nine = #{nine}, </if> |
|
||||
<if test="ten != null and ten != ''"> ten = #{ten}, </if> |
|
||||
<if test="lastTime != null"> last_time = #{lastTime}, </if> |
|
||||
<if test="one != null and one != ''"> one = #{one}, </if> |
|
||||
<if test="zero != null and zero != ''"> zero = #{zero}, </if> |
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}, </if> |
|
||||
<if test="formId != null and formId != ''"> form_id = #{formId}, </if> |
|
||||
<if test="userid != null and userid != ''"> userid = #{userid}, </if> |
|
||||
<if test="eleven != null and eleven != ''"> eleven = #{eleven}, </if> |
|
||||
<if test="twelve != null and twelve != ''"> twelve = #{twelve}, </if> |
|
||||
<if test="thirteen != null and thirteen != ''"> thirteen = #{thirteen}, </if> |
|
||||
<if test="fourteen != null and fourteen != ''"> fourteen = #{fourteen}, </if> |
|
||||
<if test="fifteen != null and fifteen != ''"> fifteen = #{fifteen}, </if> |
|
||||
<if test="attachmentUrls != null and attachmentUrls != ''"> attachment_urls = #{attachmentUrls}, </if> |
|
||||
<if test="attachmentNames != null and attachmentNames != ''"> attachment_names = #{attachmentNames}, </if> |
|
||||
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> |
|
||||
<if test="bizKey != null and bizKey != ''"> biz_key = #{bizKey}, </if> |
|
||||
<if test="deptid != null and deptid != ''"> deptid = #{deptid}, </if> |
|
||||
<if test="flowState != null and flowState != ''"> flow_state = #{flowState}, </if> |
|
||||
<if test="createTime != null"> create_time = #{createTime}, </if> |
|
||||
<if test="dqxCode != null and dqxCode != ''"> dqx_code = #{dqxCode}, </if> |
|
||||
<if test="cuserid != null and cuserid != ''"> cuserid = #{cuserid}, </if> |
|
||||
<if test="tagIds != null and tagIds != ''"> tag_ids = #{tagIds}, </if> |
|
||||
<if test="tagNames != null and tagNames != ''"> tag_names = #{tagNames}, </if> |
|
||||
<if test="cusername != null and cusername != ''"> cusername = #{cusername}, </if> |
|
||||
<if test="deptName != null and deptName != ''"> dept_name = #{deptName}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
two = #{item.two}, |
|
||||
three = #{item.three}, |
|
||||
four = #{item.four}, |
|
||||
five = #{item.five}, |
|
||||
six = #{item.six}, |
|
||||
seven = #{item.seven}, |
|
||||
eight = #{item.eight}, |
|
||||
nine = #{item.nine}, |
|
||||
ten = #{item.ten}, |
|
||||
last_time = #{item.lastTime}, |
|
||||
one = #{item.one}, |
|
||||
zero = #{item.zero}, |
|
||||
remark = #{item.remark}, |
|
||||
form_id = #{item.formId}, |
|
||||
userid = #{item.userid}, |
|
||||
eleven = #{item.eleven}, |
|
||||
twelve = #{item.twelve}, |
|
||||
thirteen = #{item.thirteen}, |
|
||||
fourteen = #{item.fourteen}, |
|
||||
fifteen = #{item.fifteen}, |
|
||||
attachment_urls = #{item.attachmentUrls}, |
|
||||
attachment_names = #{item.attachmentNames}, |
|
||||
branch_id = #{item.branchId}, |
|
||||
biz_key = #{item.bizKey}, |
|
||||
deptid = #{item.deptid}, |
|
||||
flow_state = #{item.flowState}, |
|
||||
create_time = #{item.createTime}, |
|
||||
dqx_code = #{item.dqxCode}, |
|
||||
cuserid = #{item.cuserid}, |
|
||||
tag_ids = #{item.tagIds}, |
|
||||
tag_names = #{item.tagNames}, |
|
||||
cusername = #{item.cusername}, |
|
||||
dept_name = #{item.deptName} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormDataProcessApprova"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 --> |
|
||||
<!--请在此区域添加自定义函数--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from FORM.form_data_process_approva res |
|
||||
<where> |
|
||||
<if test="ids != null"> and |
|
||||
id in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<include refid="where"/> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormDataProcessApprova" resultType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
select * from FORM.form_data_process_approva res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormDataProcessApprova" resultType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
select * from FORM.form_data_process_approva res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from FORM.form_data_process_approva res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormDataProcessApprova" resultType="long"> |
|
||||
select count(1) from FORM.form_data_process_approva res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormDataProcessApprova" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into FORM.form_data_process_approva( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{branchId},#{procInstId},#{agree},#{assignee},#{mainTitle},#{actId},#{taskName},#{commentMsg},#{id},#{eventName},#{bizKey},#{modelKey},#{flowLastTime},#{flowBranchId},#{flowState},#{startUserid},#{procDefId},#{modelName},#{formId},#{formDataId} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
delete from FORM.form_data_process_approva res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
delete from FORM.form_data_process_approva |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
update FORM.form_data_process_approva |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormDataProcessApprova"> |
|
||||
update FORM.form_data_process_approva |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update FORM.form_data_process_approva |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from FORM.form_data_process_approva |
|
||||
where id in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item.id } |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
branch_id,proc_inst_id,agree,assignee,main_title,act_id,task_name,comment_msg,id,event_name,biz_key,model_key,flow_last_time,flow_branch_id,flow_state,start_userid,proc_def_id,model_name,form_id,form_data_id |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if> |
|
||||
<if test="procInstId != null and procInstId != ''"> and res.proc_inst_id = #{procInstId} </if> |
|
||||
<if test="agree != null and agree != ''"> and res.agree = #{agree} </if> |
|
||||
<if test="assignee != null and assignee != ''"> and res.assignee = #{assignee} </if> |
|
||||
<if test="mainTitle != null and mainTitle != ''"> and res.main_title = #{mainTitle} </if> |
|
||||
<if test="actId != null and actId != ''"> and res.act_id = #{actId} </if> |
|
||||
<if test="taskName != null and taskName != ''"> and res.task_name = #{taskName} </if> |
|
||||
<if test="commentMsg != null and commentMsg != ''"> and res.comment_msg = #{commentMsg} </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="eventName != null and eventName != ''"> and res.event_name = #{eventName} </if> |
|
||||
<if test="bizKey != null and bizKey != ''"> and res.biz_key = #{bizKey} </if> |
|
||||
<if test="modelKey != null and modelKey != ''"> and res.model_key = #{modelKey} </if> |
|
||||
<if test="flowLastTime != null"> and TO_CHAR(res.flow_last_time,'YYYY-MM-DD') = TO_CHAR(#{flowLastTime},'YYYY-MM-DD') </if> |
|
||||
<if test="flowBranchId != null and flowBranchId != ''"> and res.flow_branch_id = #{flowBranchId} </if> |
|
||||
<if test="flowState != null and flowState != ''"> and res.flow_state = #{flowState} </if> |
|
||||
<if test="startUserid != null and startUserid != ''"> and res.start_userid = #{startUserid} </if> |
|
||||
<if test="procDefId != null and procDefId != ''"> and res.proc_def_id = #{procDefId} </if> |
|
||||
<if test="modelName != null and modelName != ''"> and res.model_name = #{modelName} </if> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="formDataId != null and formDataId != ''"> and res.form_data_id = #{formDataId} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
branch_id = #{branchId}, |
|
||||
proc_inst_id = #{procInstId}, |
|
||||
agree = #{agree}, |
|
||||
assignee = #{assignee}, |
|
||||
main_title = #{mainTitle}, |
|
||||
act_id = #{actId}, |
|
||||
task_name = #{taskName}, |
|
||||
comment_msg = #{commentMsg}, |
|
||||
event_name = #{eventName}, |
|
||||
biz_key = #{bizKey}, |
|
||||
model_key = #{modelKey}, |
|
||||
flow_last_time = #{flowLastTime}, |
|
||||
flow_branch_id = #{flowBranchId}, |
|
||||
flow_state = #{flowState}, |
|
||||
start_userid = #{startUserid}, |
|
||||
proc_def_id = #{procDefId}, |
|
||||
model_name = #{modelName}, |
|
||||
form_id = #{formId}, |
|
||||
form_data_id = #{formDataId} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> |
|
||||
<if test="procInstId != null and procInstId != ''"> proc_inst_id = #{procInstId}, </if> |
|
||||
<if test="agree != null and agree != ''"> agree = #{agree}, </if> |
|
||||
<if test="assignee != null and assignee != ''"> assignee = #{assignee}, </if> |
|
||||
<if test="mainTitle != null and mainTitle != ''"> main_title = #{mainTitle}, </if> |
|
||||
<if test="actId != null and actId != ''"> act_id = #{actId}, </if> |
|
||||
<if test="taskName != null and taskName != ''"> task_name = #{taskName}, </if> |
|
||||
<if test="commentMsg != null and commentMsg != ''"> comment_msg = #{commentMsg}, </if> |
|
||||
<if test="eventName != null and eventName != ''"> event_name = #{eventName}, </if> |
|
||||
<if test="bizKey != null and bizKey != ''"> biz_key = #{bizKey}, </if> |
|
||||
<if test="modelKey != null and modelKey != ''"> model_key = #{modelKey}, </if> |
|
||||
<if test="flowLastTime != null"> flow_last_time = #{flowLastTime}, </if> |
|
||||
<if test="flowBranchId != null and flowBranchId != ''"> flow_branch_id = #{flowBranchId}, </if> |
|
||||
<if test="flowState != null and flowState != ''"> flow_state = #{flowState}, </if> |
|
||||
<if test="startUserid != null and startUserid != ''"> start_userid = #{startUserid}, </if> |
|
||||
<if test="procDefId != null and procDefId != ''"> proc_def_id = #{procDefId}, </if> |
|
||||
<if test="modelName != null and modelName != ''"> model_name = #{modelName}, </if> |
|
||||
<if test="formId != null and formId != ''"> form_id = #{formId}, </if> |
|
||||
<if test="formDataId != null and formDataId != ''"> form_data_id = #{formDataId}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
branch_id = #{item.branchId}, |
|
||||
proc_inst_id = #{item.procInstId}, |
|
||||
agree = #{item.agree}, |
|
||||
assignee = #{item.assignee}, |
|
||||
main_title = #{item.mainTitle}, |
|
||||
act_id = #{item.actId}, |
|
||||
task_name = #{item.taskName}, |
|
||||
comment_msg = #{item.commentMsg}, |
|
||||
event_name = #{item.eventName}, |
|
||||
biz_key = #{item.bizKey}, |
|
||||
model_key = #{item.modelKey}, |
|
||||
flow_last_time = #{item.flowLastTime}, |
|
||||
flow_branch_id = #{item.flowBranchId}, |
|
||||
flow_state = #{item.flowState}, |
|
||||
start_userid = #{item.startUserid}, |
|
||||
proc_def_id = #{item.procDefId}, |
|
||||
model_name = #{item.modelName}, |
|
||||
form_id = #{item.formId}, |
|
||||
form_data_id = #{item.formDataId} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,176 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormDataTag"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" ids != null"> and (res.id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</sql> |
|
||||
|
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_data_tag res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormDataTag" resultType="com.mdp.form.entity.FormDataTag"> |
|
||||
select * from form_data_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormDataTag" resultType="com.mdp.form.entity.FormDataTag"> |
|
||||
select * from form_data_tag res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormDataTag"> |
|
||||
select * from form_data_tag res |
|
||||
where (res.id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_data_tag res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormDataTag" resultType="long"> |
|
||||
select count(*) from form_data_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormDataTag" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into form_data_tag( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{dataId},#{tagId},#{tagName},#{id},#{createTime} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormDataTag"> |
|
||||
delete from form_data_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormDataTag"> |
|
||||
delete from form_data_tag |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormDataTag"> |
|
||||
update form_data_tag |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormDataTag"> |
|
||||
update form_data_tag |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_data_tag |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_data_tag |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_data_tag |
|
||||
where |
|
||||
(id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.id} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
data_id,tag_id,tag_name,id,create_time |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="dataId != null and dataId != ''"> and res.data_id = #{dataId} </if> |
|
||||
<if test="tagId != null and tagId != ''"> and res.tag_id = #{tagId} </if> |
|
||||
<if test="tagName != null and tagName != ''"> and res.tag_name = #{tagName} </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="createTime != null"> and date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
data_id = #{dataId}, |
|
||||
tag_id = #{tagId}, |
|
||||
tag_name = #{tagName}, |
|
||||
create_time = #{createTime} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="dataId != null and dataId != ''"> data_id = #{dataId}, </if> |
|
||||
<if test="tagId != null and tagId != ''"> tag_id = #{tagId}, </if> |
|
||||
<if test="tagName != null and tagName != ''"> tag_name = #{tagName}, </if> |
|
||||
<if test="createTime != null"> create_time = #{createTime}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
data_id = #{item.dataId}, |
|
||||
tag_id = #{item.tagId}, |
|
||||
tag_name = #{item.tagName}, |
|
||||
create_time = #{item.createTime} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,245 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormDef"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" ids != null"> and (res.id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="categoryIds!=null"> and res.category_id in |
|
||||
<foreach collection="categoryIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test=" tagIds !=null"> and exists ( select 1 from form.form_def_tag tag where tag.form_id = res.id and tag.tag_id in |
|
||||
<foreach collection="tagIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> ) |
|
||||
</if> |
|
||||
<if test="key != null and key !='' "> and res.form_name like #{key} </if> |
|
||||
</sql> |
|
||||
|
|
||||
<update id="updateTagsById" parameterType="HashMap"> |
|
||||
update FORM.form_def |
|
||||
set tag_ids=#{tagIds},tag_names=#{tagNames} where id=#{id} |
|
||||
</update> |
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_def res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormDef" resultType="com.mdp.form.entity.FormDef"> |
|
||||
select * from form_def res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormDef" resultType="com.mdp.form.entity.FormDef"> |
|
||||
select * from form_def res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormDef"> |
|
||||
select * from form_def res |
|
||||
where (res.id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_def res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormDef" resultType="long"> |
|
||||
select count(*) from form_def res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormDef" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into form_def( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{id},#{tableName},#{tableOwner},#{isCreateTable},#{formName},#{userid},#{deptid},#{formType},#{isTemplate},#{bizType},#{ctime},#{branchId},#{categoryId},#{tagIds},#{tagNames},#{username},#{deptName},#{groupsJson},#{pks} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormDef"> |
|
||||
delete from form_def res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormDef"> |
|
||||
delete from form_def |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormDef"> |
|
||||
update form_def |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormDef"> |
|
||||
update form_def |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_def |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_def |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_def |
|
||||
where |
|
||||
(id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.id} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
id,table_name,table_owner,is_create_table,form_name,userid,deptid,form_type,is_template,biz_type,ctime,branch_id,category_id,tag_ids,tag_names,username,dept_name,groups_json,pks |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="tableName != null and tableName != ''"> and res.table_name = #{tableName} </if> |
|
||||
<if test="tableOwner != null and tableOwner != ''"> and res.table_owner = #{tableOwner} </if> |
|
||||
<if test="isCreateTable != null and isCreateTable != ''"> and res.is_create_table = #{isCreateTable} </if> |
|
||||
<if test="formName != null and formName != ''"> and res.form_name = #{formName} </if> |
|
||||
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> |
|
||||
<if test="deptid != null and deptid != ''"> and res.deptid = #{deptid} </if> |
|
||||
<if test="formType != null and formType != ''"> and res.form_type = #{formType} </if> |
|
||||
<if test="isTemplate != null and isTemplate != ''"> and res.is_template = #{isTemplate} </if> |
|
||||
<if test="bizType != null and bizType != ''"> and res.biz_type = #{bizType} </if> |
|
||||
<if test="ctime != null"> and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') </if> |
|
||||
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if> |
|
||||
<if test="categoryId != null and categoryId != ''"> and res.category_id = #{categoryId} </if> |
|
||||
<if test="tagIds != null and tagIds != ''"> and res.tag_ids = #{tagIds} </if> |
|
||||
<if test="tagNames != null and tagNames != ''"> and res.tag_names = #{tagNames} </if> |
|
||||
<if test="username != null and username != ''"> and res.username = #{username} </if> |
|
||||
<if test="deptName != null and deptName != ''"> and res.dept_name = #{deptName} </if> |
|
||||
<if test="groupsJson != null and groupsJson != ''"> and res.groups_json = #{groupsJson} </if> |
|
||||
<if test="pks != null and pks != ''"> and res.pks = #{pks} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
table_name = #{tableName}, |
|
||||
table_owner = #{tableOwner}, |
|
||||
is_create_table = #{isCreateTable}, |
|
||||
form_name = #{formName}, |
|
||||
userid = #{userid}, |
|
||||
deptid = #{deptid}, |
|
||||
form_type = #{formType}, |
|
||||
is_template = #{isTemplate}, |
|
||||
biz_type = #{bizType}, |
|
||||
ctime = #{ctime}, |
|
||||
branch_id = #{branchId}, |
|
||||
category_id = #{categoryId}, |
|
||||
tag_ids = #{tagIds}, |
|
||||
tag_names = #{tagNames}, |
|
||||
username = #{username}, |
|
||||
dept_name = #{deptName}, |
|
||||
groups_json = #{groupsJson}, |
|
||||
pks = #{pks} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="tableName != null and tableName != ''"> table_name = #{tableName}, </if> |
|
||||
<if test="tableOwner != null and tableOwner != ''"> table_owner = #{tableOwner}, </if> |
|
||||
<if test="isCreateTable != null and isCreateTable != ''"> is_create_table = #{isCreateTable}, </if> |
|
||||
<if test="formName != null and formName != ''"> form_name = #{formName}, </if> |
|
||||
<if test="userid != null and userid != ''"> userid = #{userid}, </if> |
|
||||
<if test="deptid != null and deptid != ''"> deptid = #{deptid}, </if> |
|
||||
<if test="formType != null and formType != ''"> form_type = #{formType}, </if> |
|
||||
<if test="isTemplate != null and isTemplate != ''"> is_template = #{isTemplate}, </if> |
|
||||
<if test="bizType != null and bizType != ''"> biz_type = #{bizType}, </if> |
|
||||
<if test="ctime != null"> ctime = #{ctime}, </if> |
|
||||
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> |
|
||||
<if test="categoryId != null and categoryId != ''"> category_id = #{categoryId}, </if> |
|
||||
<if test="tagIds != null and tagIds != ''"> tag_ids = #{tagIds}, </if> |
|
||||
<if test="tagNames != null and tagNames != ''"> tag_names = #{tagNames}, </if> |
|
||||
<if test="username != null and username != ''"> username = #{username}, </if> |
|
||||
<if test="deptName != null and deptName != ''"> dept_name = #{deptName}, </if> |
|
||||
<if test="groupsJson != null and groupsJson != ''"> groups_json = #{groupsJson}, </if> |
|
||||
<if test="pks != null and pks != ''"> pks = #{pks}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
table_name = #{item.tableName}, |
|
||||
table_owner = #{item.tableOwner}, |
|
||||
is_create_table = #{item.isCreateTable}, |
|
||||
form_name = #{item.formName}, |
|
||||
userid = #{item.userid}, |
|
||||
deptid = #{item.deptid}, |
|
||||
form_type = #{item.formType}, |
|
||||
is_template = #{item.isTemplate}, |
|
||||
biz_type = #{item.bizType}, |
|
||||
ctime = #{item.ctime}, |
|
||||
branch_id = #{item.branchId}, |
|
||||
category_id = #{item.categoryId}, |
|
||||
tag_ids = #{item.tagIds}, |
|
||||
tag_names = #{item.tagNames}, |
|
||||
username = #{item.username}, |
|
||||
dept_name = #{item.deptName}, |
|
||||
groups_json = #{item.groupsJson}, |
|
||||
pks = #{item.pks} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,158 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormDefTag"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 --> |
|
||||
<!--请在此区域添加自定义函数--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from FORM.form_def_tag res |
|
||||
<where> |
|
||||
<if test="ids != null"> and |
|
||||
id in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<include refid="where"/> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormDefTag" resultType="com.mdp.form.entity.FormDefTag"> |
|
||||
select * from FORM.form_def_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormDefTag" resultType="com.mdp.form.entity.FormDefTag"> |
|
||||
select * from FORM.form_def_tag res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from FORM.form_def_tag res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormDefTag" resultType="long"> |
|
||||
select count(1) from FORM.form_def_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormDefTag" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into FORM.form_def_tag( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{formId},#{tagId},#{tagName},#{id},#{createTime} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormDefTag"> |
|
||||
delete from FORM.form_def_tag res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormDefTag"> |
|
||||
delete from FORM.form_def_tag |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormDefTag"> |
|
||||
update FORM.form_def_tag |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormDefTag"> |
|
||||
update FORM.form_def_tag |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
begin |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update FORM.form_def_tag |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
;end; |
|
||||
</update> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from FORM.form_def_tag |
|
||||
where id in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item.id } |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
form_id,tag_id,tag_name,id,create_time |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="tagId != null and tagId != ''"> and res.tag_id = #{tagId} </if> |
|
||||
<if test="tagName != null and tagName != ''"> and res.tag_name = #{tagName} </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="createTime != null"> and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
form_id = #{formId}, |
|
||||
tag_id = #{tagId}, |
|
||||
tag_name = #{tagName}, |
|
||||
create_time = #{createTime} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="formId != null and formId != ''"> form_id = #{formId}, </if> |
|
||||
<if test="tagId != null and tagId != ''"> tag_id = #{tagId}, </if> |
|
||||
<if test="tagName != null and tagName != ''"> tag_name = #{tagName}, </if> |
|
||||
<if test="createTime != null"> create_time = #{createTime}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
form_id = #{item.formId}, |
|
||||
tag_id = #{item.tagId}, |
|
||||
tag_name = #{item.tagName}, |
|
||||
create_time = #{item.createTime} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,240 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormField"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" ids != null"> and (res.id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</sql> |
|
||||
<delete id="deleteByFormId" parameterType="String"> |
|
||||
delete from FORM.form_field where form_id=#{formId} |
|
||||
|
|
||||
</delete> |
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_field res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
order by res.seq_no asc |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormField" resultType="com.mdp.form.entity.FormField"> |
|
||||
select * from form_field res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormField" resultType="com.mdp.form.entity.FormField"> |
|
||||
select * from form_field res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormField"> |
|
||||
select * from form_field res |
|
||||
where (res.id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_field res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormField" resultType="long"> |
|
||||
select count(*) from form_field res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormField" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into form_field( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{formId},#{id},#{fieldId},#{fieldTitle},#{dictCode},#{fieldType},#{fieldLength},#{defaultValue},#{isMultiple},#{placeholder},#{isRequired},#{isDict},#{fieldIdCamel},#{remark},#{extFieldType},#{toFlow},#{flowFieldId},#{isBizKey},#{seqNo},#{groupId} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormField"> |
|
||||
delete from form_field res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormField"> |
|
||||
delete from form_field |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormField"> |
|
||||
update form_field |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormField"> |
|
||||
update form_field |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_field |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_field |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_field |
|
||||
where |
|
||||
(id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.id} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
form_id,id,field_id,field_title,dict_code,field_type,field_length,default_value,is_multiple,placeholder,is_required,is_dict,field_id_camel,remark,ext_field_type,to_flow,flow_field_id,is_biz_key,seq_no,group_id |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="fieldId != null and fieldId != ''"> and res.field_id = #{fieldId} </if> |
|
||||
<if test="fieldTitle != null and fieldTitle != ''"> and res.field_title = #{fieldTitle} </if> |
|
||||
<if test="dictCode != null and dictCode != ''"> and res.dict_code = #{dictCode} </if> |
|
||||
<if test="fieldType != null and fieldType != ''"> and res.field_type = #{fieldType} </if> |
|
||||
<if test="fieldLength != null and fieldLength != ''"> and res.field_length = #{fieldLength} </if> |
|
||||
<if test="defaultValue != null and defaultValue != ''"> and res.default_value = #{defaultValue} </if> |
|
||||
<if test="isMultiple != null and isMultiple != ''"> and res.is_multiple = #{isMultiple} </if> |
|
||||
<if test="placeholder != null and placeholder != ''"> and res.placeholder = #{placeholder} </if> |
|
||||
<if test="isRequired != null and isRequired != ''"> and res.is_required = #{isRequired} </if> |
|
||||
<if test="isDict != null and isDict != ''"> and res.is_dict = #{isDict} </if> |
|
||||
<if test="fieldIdCamel != null and fieldIdCamel != ''"> and res.field_id_camel = #{fieldIdCamel} </if> |
|
||||
<if test="remark != null and remark != ''"> and res.remark = #{remark} </if> |
|
||||
<if test="extFieldType != null and extFieldType != ''"> and res.ext_field_type = #{extFieldType} </if> |
|
||||
<if test="toFlow != null and toFlow != ''"> and res.to_flow = #{toFlow} </if> |
|
||||
<if test="flowFieldId != null and flowFieldId != ''"> and res.flow_field_id = #{flowFieldId} </if> |
|
||||
<if test="isBizKey != null and isBizKey != ''"> and res.is_biz_key = #{isBizKey} </if> |
|
||||
<if test="seqNo != null and seqNo != ''"> and res.seq_no = #{seqNo} </if> |
|
||||
<if test="groupId != null and groupId != ''"> and res.group_id = #{groupId} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
form_id = #{formId}, |
|
||||
field_id = #{fieldId}, |
|
||||
field_title = #{fieldTitle}, |
|
||||
dict_code = #{dictCode}, |
|
||||
field_type = #{fieldType}, |
|
||||
field_length = #{fieldLength}, |
|
||||
default_value = #{defaultValue}, |
|
||||
is_multiple = #{isMultiple}, |
|
||||
placeholder = #{placeholder}, |
|
||||
is_required = #{isRequired}, |
|
||||
is_dict = #{isDict}, |
|
||||
field_id_camel = #{fieldIdCamel}, |
|
||||
remark = #{remark}, |
|
||||
ext_field_type = #{extFieldType}, |
|
||||
to_flow = #{toFlow}, |
|
||||
flow_field_id = #{flowFieldId}, |
|
||||
is_biz_key = #{isBizKey}, |
|
||||
seq_no = #{seqNo}, |
|
||||
group_id = #{groupId} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="formId != null and formId != ''"> form_id = #{formId}, </if> |
|
||||
<if test="fieldId != null and fieldId != ''"> field_id = #{fieldId}, </if> |
|
||||
<if test="fieldTitle != null and fieldTitle != ''"> field_title = #{fieldTitle}, </if> |
|
||||
<if test="dictCode != null and dictCode != ''"> dict_code = #{dictCode}, </if> |
|
||||
<if test="fieldType != null and fieldType != ''"> field_type = #{fieldType}, </if> |
|
||||
<if test="fieldLength != null and fieldLength != ''"> field_length = #{fieldLength}, </if> |
|
||||
<if test="defaultValue != null and defaultValue != ''"> default_value = #{defaultValue}, </if> |
|
||||
<if test="isMultiple != null and isMultiple != ''"> is_multiple = #{isMultiple}, </if> |
|
||||
<if test="placeholder != null and placeholder != ''"> placeholder = #{placeholder}, </if> |
|
||||
<if test="isRequired != null and isRequired != ''"> is_required = #{isRequired}, </if> |
|
||||
<if test="isDict != null and isDict != ''"> is_dict = #{isDict}, </if> |
|
||||
<if test="fieldIdCamel != null and fieldIdCamel != ''"> field_id_camel = #{fieldIdCamel}, </if> |
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}, </if> |
|
||||
<if test="extFieldType != null and extFieldType != ''"> ext_field_type = #{extFieldType}, </if> |
|
||||
<if test="toFlow != null and toFlow != ''"> to_flow = #{toFlow}, </if> |
|
||||
<if test="flowFieldId != null and flowFieldId != ''"> flow_field_id = #{flowFieldId}, </if> |
|
||||
<if test="isBizKey != null and isBizKey != ''"> is_biz_key = #{isBizKey}, </if> |
|
||||
<if test="seqNo != null and seqNo != ''"> seq_no = #{seqNo}, </if> |
|
||||
<if test="groupId != null and groupId != ''"> group_id = #{groupId}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
form_id = #{item.formId}, |
|
||||
field_id = #{item.fieldId}, |
|
||||
field_title = #{item.fieldTitle}, |
|
||||
dict_code = #{item.dictCode}, |
|
||||
field_type = #{item.fieldType}, |
|
||||
field_length = #{item.fieldLength}, |
|
||||
default_value = #{item.defaultValue}, |
|
||||
is_multiple = #{item.isMultiple}, |
|
||||
placeholder = #{item.placeholder}, |
|
||||
is_required = #{item.isRequired}, |
|
||||
is_dict = #{item.isDict}, |
|
||||
field_id_camel = #{item.fieldIdCamel}, |
|
||||
remark = #{item.remark}, |
|
||||
ext_field_type = #{item.extFieldType}, |
|
||||
to_flow = #{item.toFlow}, |
|
||||
flow_field_id = #{item.flowFieldId}, |
|
||||
is_biz_key = #{item.isBizKey}, |
|
||||
seq_no = #{item.seqNo}, |
|
||||
group_id = #{item.groupId} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,204 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormQx"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" formIds != null"> and (res.form_id) in |
|
||||
<foreach collection="formIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</sql> |
|
||||
|
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_qx res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormQx" resultType="com.mdp.form.entity.FormQx"> |
|
||||
select * from form_qx res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormQx" resultType="com.mdp.form.entity.FormQx"> |
|
||||
select * from form_qx res |
|
||||
where |
|
||||
res.form_id = #{formId} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormQx"> |
|
||||
select * from form_qx res |
|
||||
where (res.form_id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_qx res |
|
||||
where |
|
||||
res.form_id = #{formId} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormQx" resultType="long"> |
|
||||
select count(*) from form_qx res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键form_id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormQx" useGeneratedKeys="false" keyProperty="form_id"> |
|
||||
insert into form_qx( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{formId},#{allowQueryRoleids},#{allowQueryDeptids},#{allowQueryUserids},#{notQueryRoleids},#{notQueryDeptids},#{notQueryUserids},#{allowOtherQuery},#{allowOtherEdit},#{allowOtherDel},#{doDeptLvlCheck},#{deptLvlQx} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormQx"> |
|
||||
delete from form_qx res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormQx"> |
|
||||
delete from form_qx |
|
||||
where form_id = #{formId} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormQx"> |
|
||||
update form_qx |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where form_id = #{formId} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormQx"> |
|
||||
update form_qx |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where form_id = #{formId} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_qx |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where form_id = #{item.formId} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_qx |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (form_id) in |
|
||||
<foreach collection="formIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_qx |
|
||||
where |
|
||||
(form_id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.formId} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
form_id,allow_query_roleids,allow_query_deptids,allow_query_userids,not_query_roleids,not_query_deptids,not_query_userids,allow_other_query,allow_other_edit,allow_other_del,do_dept_lvl_check,dept_lvl_qx |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="allowQueryRoleids != null and allowQueryRoleids != ''"> and res.allow_query_roleids = #{allowQueryRoleids} </if> |
|
||||
<if test="allowQueryDeptids != null and allowQueryDeptids != ''"> and res.allow_query_deptids = #{allowQueryDeptids} </if> |
|
||||
<if test="allowQueryUserids != null and allowQueryUserids != ''"> and res.allow_query_userids = #{allowQueryUserids} </if> |
|
||||
<if test="notQueryRoleids != null and notQueryRoleids != ''"> and res.not_query_roleids = #{notQueryRoleids} </if> |
|
||||
<if test="notQueryDeptids != null and notQueryDeptids != ''"> and res.not_query_deptids = #{notQueryDeptids} </if> |
|
||||
<if test="notQueryUserids != null and notQueryUserids != ''"> and res.not_query_userids = #{notQueryUserids} </if> |
|
||||
<if test="allowOtherQuery != null and allowOtherQuery != ''"> and res.allow_other_query = #{allowOtherQuery} </if> |
|
||||
<if test="allowOtherEdit != null and allowOtherEdit != ''"> and res.allow_other_edit = #{allowOtherEdit} </if> |
|
||||
<if test="allowOtherDel != null and allowOtherDel != ''"> and res.allow_other_del = #{allowOtherDel} </if> |
|
||||
<if test="doDeptLvlCheck != null and doDeptLvlCheck != ''"> and res.do_dept_lvl_check = #{doDeptLvlCheck} </if> |
|
||||
<if test="deptLvlQx != null and deptLvlQx != ''"> and res.dept_lvl_qx = #{deptLvlQx} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
allow_query_roleids = #{allowQueryRoleids}, |
|
||||
allow_query_deptids = #{allowQueryDeptids}, |
|
||||
allow_query_userids = #{allowQueryUserids}, |
|
||||
not_query_roleids = #{notQueryRoleids}, |
|
||||
not_query_deptids = #{notQueryDeptids}, |
|
||||
not_query_userids = #{notQueryUserids}, |
|
||||
allow_other_query = #{allowOtherQuery}, |
|
||||
allow_other_edit = #{allowOtherEdit}, |
|
||||
allow_other_del = #{allowOtherDel}, |
|
||||
do_dept_lvl_check = #{doDeptLvlCheck}, |
|
||||
dept_lvl_qx = #{deptLvlQx} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="allowQueryRoleids != null and allowQueryRoleids != ''"> allow_query_roleids = #{allowQueryRoleids}, </if> |
|
||||
<if test="allowQueryDeptids != null and allowQueryDeptids != ''"> allow_query_deptids = #{allowQueryDeptids}, </if> |
|
||||
<if test="allowQueryUserids != null and allowQueryUserids != ''"> allow_query_userids = #{allowQueryUserids}, </if> |
|
||||
<if test="notQueryRoleids != null and notQueryRoleids != ''"> not_query_roleids = #{notQueryRoleids}, </if> |
|
||||
<if test="notQueryDeptids != null and notQueryDeptids != ''"> not_query_deptids = #{notQueryDeptids}, </if> |
|
||||
<if test="notQueryUserids != null and notQueryUserids != ''"> not_query_userids = #{notQueryUserids}, </if> |
|
||||
<if test="allowOtherQuery != null and allowOtherQuery != ''"> allow_other_query = #{allowOtherQuery}, </if> |
|
||||
<if test="allowOtherEdit != null and allowOtherEdit != ''"> allow_other_edit = #{allowOtherEdit}, </if> |
|
||||
<if test="allowOtherDel != null and allowOtherDel != ''"> allow_other_del = #{allowOtherDel}, </if> |
|
||||
<if test="doDeptLvlCheck != null and doDeptLvlCheck != ''"> do_dept_lvl_check = #{doDeptLvlCheck}, </if> |
|
||||
<if test="deptLvlQx != null and deptLvlQx != ''"> dept_lvl_qx = #{deptLvlQx}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
allow_query_roleids = #{item.allowQueryRoleids}, |
|
||||
allow_query_deptids = #{item.allowQueryDeptids}, |
|
||||
allow_query_userids = #{item.allowQueryUserids}, |
|
||||
not_query_roleids = #{item.notQueryRoleids}, |
|
||||
not_query_deptids = #{item.notQueryDeptids}, |
|
||||
not_query_userids = #{item.notQueryUserids}, |
|
||||
allow_other_query = #{item.allowOtherQuery}, |
|
||||
allow_other_edit = #{item.allowOtherEdit}, |
|
||||
allow_other_del = #{item.allowOtherDel}, |
|
||||
do_dept_lvl_check = #{item.doDeptLvlCheck}, |
|
||||
dept_lvl_qx = #{item.deptLvlQx} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,172 +0,0 @@ |
|||||
<?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.mdp.form.entity.FormView"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
||||
|
|
||||
<sql id="whereForMap"> |
|
||||
<if test=" ids != null"> and (res.id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="key != null and key !='' "> </if> |
|
||||
</sql> |
|
||||
|
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_view res |
|
||||
<where> |
|
||||
<include refid="whereForMap"/> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.mdp.form.entity.FormView" resultType="com.mdp.form.entity.FormView"> |
|
||||
select * from form_view res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormView" resultType="com.mdp.form.entity.FormView"> |
|
||||
select * from form_view res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<select id="selectListByIds" parameterType="List" resultType="com.mdp.form.entity.FormView"> |
|
||||
select * from form_view res |
|
||||
where (res.id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</select> |
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from form_view res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.mdp.form.entity.FormView" resultType="long"> |
|
||||
select count(*) from form_view res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.mdp.form.entity.FormView" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into form_view( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{formId},#{id},#{viewContext},#{bizId} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormView"> |
|
||||
delete from form_view res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormView"> |
|
||||
delete from form_view |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormView"> |
|
||||
update form_view |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.mdp.form.entity.FormView"> |
|
||||
update form_view |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update form_view |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改某几个字段 --> |
|
||||
<delete id="editSomeFields" parameterType="HashMap"> |
|
||||
update form_view |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where (id) in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item}) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from form_view |
|
||||
where |
|
||||
(id) in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
( #{item.id} ) |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
form_id,id,view_context,biz_id |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="formId != null and formId != ''"> and res.form_id = #{formId} </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="viewContext != null and viewContext != ''"> and res.view_context = #{viewContext} </if> |
|
||||
<if test="bizId != null and bizId != ''"> and res.biz_id = #{bizId} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
form_id = #{formId}, |
|
||||
view_context = #{viewContext}, |
|
||||
biz_id = #{bizId} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="formId != null and formId != ''"> form_id = #{formId}, </if> |
|
||||
<if test="viewContext != null and viewContext != ''"> view_context = #{viewContext}, </if> |
|
||||
<if test="bizId != null and bizId != ''"> biz_id = #{bizId}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
form_id = #{item.formId}, |
|
||||
view_context = #{item.viewContext}, |
|
||||
biz_id = #{item.bizId} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
@ -1,49 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN" |
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd"> |
|
||||
<configuration> |
|
||||
<settings> |
|
||||
<setting name="cacheEnabled" value="true" /><!-- 全局映射器启用缓存 --> |
|
||||
<setting name="useGeneratedKeys" value="true" /> |
|
||||
<setting name="defaultExecutorType" value="REUSE" /> |
|
||||
<setting name="mapUnderscoreToCamelCase" value="true" /> |
|
||||
<setting name="callSettersOnNulls" value="true" /> |
|
||||
<setting name="jdbcTypeForNull" value="NULL"/> |
|
||||
</settings> |
|
||||
<typeHandlers> |
|
||||
<typeHandler javaType="String" jdbcType="CLOB" handler="org.apache.ibatis.type.ClobTypeHandler"/> |
|
||||
<!--<typeHandler javaType="oracle.sql.CLOB" jdbcType="CLOB" handler="org.apache.ibatis.type.ClobTypeHandler"/>--> |
|
||||
<!--<typeHandler javaType="oracle.sql.TIMESTAMP" jdbcType="TIMESTAMP" handler="org.apache.ibatis.type.DateTypeHandler"/>--> |
|
||||
</typeHandlers> |
|
||||
<objectWrapperFactory type="com.mdp.mybatis.MapWrapperFactory"></objectWrapperFactory> |
|
||||
<plugins> |
|
||||
<!-- com.github.pagehelper为PageHelper类所在包名 --> |
|
||||
<plugin interceptor="com.github.pagehelper.PageInterceptor"> |
|
||||
<!-- 4.0.0以后版本可以不设置该参数--> |
|
||||
<!--<property name="dialect" value="oracle"/> --> |
|
||||
<!-- 该参数默认为false --> |
|
||||
<!-- 设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用 --> |
|
||||
<!-- 和startPage中的pageNum效果一样--> |
|
||||
<property name="offsetAsPageNum" value="true"/> |
|
||||
<!-- 该参数默认为false --> |
|
||||
<!-- 设置为true时,使用RowBounds分页会进行count查询 --> |
|
||||
<property name="rowBoundsWithCount" value="true"/> |
|
||||
<!-- 设置为true时,如果pageSize=0或者RowBounds.limit = 0就会查询出全部的结果 --> |
|
||||
<!-- (相当于没有执行分页查询,但是返回结果仍然是Page类型)--> |
|
||||
<property name="pageSizeZero" value="true"/> |
|
||||
<!-- 3.3.0版本可用 - 分页参数合理化,默认false禁用 --> |
|
||||
<!-- 启用合理化时,如果pageNum<1会查询第一页,如果pageNum>pages会查询最后一页 --> |
|
||||
<!-- 禁用合理化时,如果pageNum<1或pageNum>pages会返回空数据 --> |
|
||||
<property name="reasonable" value="true"/> |
|
||||
<!-- 3.5.0版本可用 - 为了支持startPage(Object params)方法 --> |
|
||||
<!-- 增加了一个`params`参数来配置参数映射,用于从Map或ServletRequest中取值 --> |
|
||||
<!-- 可以配置pageNum,pageSize,count,pageSizeZero,reasonable,orderBy,不配置映射的用默认值 --> |
|
||||
<!-- 不理解该含义的前提下,不要随便复制该配置 --> |
|
||||
<!-- <property name="params" value="pageNum=currentPage;pageSize=limit;"/> --> |
|
||||
<!-- 支持通过Mapper接口参数来传递分页参数 --> |
|
||||
<!-- <property name="supportMethodsArguments" value="true"/>--> |
|
||||
<!-- always总是返回PageInfo类型,check检查返回类型是否为PageInfo,none返回Page --> |
|
||||
<!-- <property name="returnPageInfo" value="check"/>--> |
|
||||
</plugin> |
|
||||
</plugins> |
|
||||
</configuration> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue