|
|
|
@ -3,12 +3,16 @@ |
|
|
|
<mapper namespace="com.mdp.form.entity.FormField"> |
|
|
|
|
|
|
|
|
|
|
|
<!--开始 自定sql函数区域 --> |
|
|
|
<!--请在此区域添加自定义函数--> |
|
|
|
<!--开始 自定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} |
|
|
|
|
|
|
|
@ -20,23 +24,17 @@ |
|
|
|
|
|
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select * from FORM.form_field res |
|
|
|
select * from form_field res |
|
|
|
<where> |
|
|
|
<if test="ids != null"> and |
|
|
|
id in |
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<include refid="whereForMap"/> |
|
|
|
<include refid="where"/> |
|
|
|
<if test="key != null and key !='' "> </if> |
|
|
|
</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.form_field res |
|
|
|
select * from form_field res |
|
|
|
<where> |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
@ -44,36 +42,42 @@ |
|
|
|
|
|
|
|
<!-- 通过主键查询获取数据对象 返回object --> |
|
|
|
<select id="selectOneObject" parameterType="com.mdp.form.entity.FormField" resultType="com.mdp.form.entity.FormField"> |
|
|
|
select * from FORM.form_field res |
|
|
|
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.form_field res |
|
|
|
select * from form_field res |
|
|
|
where |
|
|
|
res.id = #{id} |
|
|
|
</select> |
|
|
|
<!-- 获取数据条目 返回long --> |
|
|
|
<select id="countByWhere" parameterType="com.mdp.form.entity.FormField" resultType="long"> |
|
|
|
select count(1) from FORM.form_field res |
|
|
|
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.form_field( |
|
|
|
insert into form_field( |
|
|
|
<include refid="columns"/> |
|
|
|
) values ( |
|
|
|
#{formId},#{id},#{fieldId},#{fieldTitle},#{secondCodeRow},#{fieldType},#{fieldLength},#{defaultValue},#{isMultiple},#{placeholder},#{isRequired},#{isFromBaseData},#{fieldIdCamel},#{remark},#{extFieldType},#{isCloneToFlow},#{flowFieldId},#{isBizKey},#{seqNo} |
|
|
|
#{formId},#{id},#{fieldId},#{fieldTitle},#{dictCode},#{fieldType},#{fieldLength},#{defaultValue},#{isMultiple},#{placeholder},#{isRequired},#{isDict},#{fieldIdCamel},#{remark},#{extFieldType},#{toFlow},#{flowFieldId},#{isBizKey},#{seqNo},#{groupName} |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 按条件删除若干条记录--> |
|
|
|
<delete id="deleteByWhere" parameterType="com.mdp.form.entity.FormField"> |
|
|
|
delete from FORM.form_field res |
|
|
|
delete from form_field res |
|
|
|
<where> |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
@ -81,13 +85,13 @@ |
|
|
|
|
|
|
|
<!-- 按主键删除一条记录--> |
|
|
|
<delete id="deleteByPk" parameterType="com.mdp.form.entity.FormField"> |
|
|
|
delete from FORM.form_field |
|
|
|
delete from form_field |
|
|
|
where id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
|
<update id="updateSomeFieldByPk" parameterType="com.mdp.form.entity.FormField"> |
|
|
|
update FORM.form_field |
|
|
|
update form_field |
|
|
|
<set> |
|
|
|
<include refid="someFieldSet"/> |
|
|
|
</set> |
|
|
|
@ -96,7 +100,7 @@ |
|
|
|
|
|
|
|
<!-- 根据主键修改一条记录 --> |
|
|
|
<update id="updateByPk" parameterType="com.mdp.form.entity.FormField"> |
|
|
|
update FORM.form_field |
|
|
|
update form_field |
|
|
|
<set> |
|
|
|
<include refid="set"/> |
|
|
|
</set> |
|
|
|
@ -110,28 +114,39 @@ |
|
|
|
|
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="batchUpdate" parameterType="List"> |
|
|
|
begin |
|
|
|
<foreach collection="list" item="item" index="index" separator=";" > |
|
|
|
update FORM.form_field |
|
|
|
update form_field |
|
|
|
set |
|
|
|
<include refid="batchSet"/> |
|
|
|
where id = #{item.id} |
|
|
|
</foreach> |
|
|
|
;end; |
|
|
|
</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.form_field |
|
|
|
where id in |
|
|
|
delete from form_field |
|
|
|
where |
|
|
|
(id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
#{item.id } |
|
|
|
( #{item.id} ) |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
|
<sql id="columns"> |
|
|
|
form_id,id,field_id,field_title,second_code_row,field_type,field_length,default_value,is_multiple,placeholder,is_required,is_from_base_data,field_id_camel,remark,ext_field_type,is_clone_to_flow,flow_field_id,is_biz_key,seq_no |
|
|
|
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_name |
|
|
|
</sql> |
|
|
|
|
|
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
|
@ -140,82 +155,86 @@ |
|
|
|
<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="secondCodeRow != null and secondCodeRow != ''"> and res.second_code_row = #{secondCodeRow} </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="isFromBaseData != null and isFromBaseData != ''"> and res.is_from_base_data = #{isFromBaseData} </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="isCloneToFlow != null and isCloneToFlow != ''"> and res.is_clone_to_flow = #{isCloneToFlow} </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="groupName != null and groupName != ''"> and res.group_name = #{groupName} </if> |
|
|
|
</sql> |
|
|
|
<!--sql片段 更新字段 --> |
|
|
|
<sql id="set"> |
|
|
|
form_id = #{formId}, |
|
|
|
field_id = #{fieldId}, |
|
|
|
field_title = #{fieldTitle}, |
|
|
|
second_code_row = #{secondCodeRow}, |
|
|
|
dict_code = #{dictCode}, |
|
|
|
field_type = #{fieldType}, |
|
|
|
field_length = #{fieldLength}, |
|
|
|
default_value = #{defaultValue}, |
|
|
|
is_multiple = #{isMultiple}, |
|
|
|
placeholder = #{placeholder}, |
|
|
|
is_required = #{isRequired}, |
|
|
|
is_from_base_data = #{isFromBaseData}, |
|
|
|
is_dict = #{isDict}, |
|
|
|
field_id_camel = #{fieldIdCamel}, |
|
|
|
remark = #{remark}, |
|
|
|
ext_field_type = #{extFieldType}, |
|
|
|
is_clone_to_flow = #{isCloneToFlow}, |
|
|
|
to_flow = #{toFlow}, |
|
|
|
flow_field_id = #{flowFieldId}, |
|
|
|
is_biz_key = #{isBizKey}, |
|
|
|
seq_no = #{seqNo} |
|
|
|
seq_no = #{seqNo}, |
|
|
|
group_name = #{groupName} |
|
|
|
</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="secondCodeRow != null and secondCodeRow != ''"> second_code_row = #{secondCodeRow}, </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="isFromBaseData != null and isFromBaseData != ''"> is_from_base_data = #{isFromBaseData}, </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="isCloneToFlow != null and isCloneToFlow != ''"> is_clone_to_flow = #{isCloneToFlow}, </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="groupName != null and groupName != ''"> group_name = #{groupName}, </if> |
|
|
|
</sql> |
|
|
|
<!--sql片段 批量更新 --> |
|
|
|
<sql id="batchSet"> |
|
|
|
form_id = #{item.formId}, |
|
|
|
field_id = #{item.fieldId}, |
|
|
|
field_title = #{item.fieldTitle}, |
|
|
|
second_code_row = #{item.secondCodeRow}, |
|
|
|
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_from_base_data = #{item.isFromBaseData}, |
|
|
|
is_dict = #{item.isDict}, |
|
|
|
field_id_camel = #{item.fieldIdCamel}, |
|
|
|
remark = #{item.remark}, |
|
|
|
ext_field_type = #{item.extFieldType}, |
|
|
|
is_clone_to_flow = #{item.isCloneToFlow}, |
|
|
|
to_flow = #{item.toFlow}, |
|
|
|
flow_field_id = #{item.flowFieldId}, |
|
|
|
is_biz_key = #{item.isBizKey}, |
|
|
|
seq_no = #{item.seqNo} |
|
|
|
seq_no = #{item.seqNo}, |
|
|
|
group_name = #{item.groupName} |
|
|
|
</sql> |
|
|
|
</mapper> |