1 changed files with 0 additions and 173 deletions
@ -1,173 +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.xm.core.entity.XmIterationMenu"> |
|||
|
|||
|
|||
<!--开始 自定sql函数区域 --> |
|||
<!--请在此区域添加自定义函数--> |
|||
|
|||
|
|||
|
|||
<!--结束 自定义sql函数区域--> |
|||
|
|||
|
|||
|
|||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|||
select res.*,m.menu_name,m.seq_no,m.pmenu_id,m.mm_userid,m.mm_username,m.children_cnt,m.ntype from xm_iteration_menu res left join xm_menu m on m.menu_id=res.menu_id |
|||
<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 !='' "> and m.menu_name like #{key} </if> |
|||
</where> |
|||
order by m.seq_no asc |
|||
</select> |
|||
|
|||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|||
<select id="selectListByWhere" parameterType="com.xm.core.entity.XmIterationMenu" resultType="com.xm.core.entity.XmIterationMenu"> |
|||
select * from xm_iteration_menu res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</select> |
|||
|
|||
<!-- 通过主键查询获取数据对象 返回object --> |
|||
<select id="selectOneObject" parameterType="com.xm.core.entity.XmIterationMenu" resultType="com.xm.core.entity.XmIterationMenu"> |
|||
select * from xm_iteration_menu res |
|||
where |
|||
res.id = #{id} |
|||
</select> |
|||
|
|||
<!-- 通过主键查询获取数据对象 返回map--> |
|||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|||
select * from xm_iteration_menu res |
|||
where |
|||
res.id = #{id} |
|||
</select> |
|||
<!-- 获取数据条目 返回long --> |
|||
<select id="countByWhere" parameterType="com.xm.core.entity.XmIterationMenu" resultType="long"> |
|||
select count(1) from xm_iteration_menu res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</select> |
|||
<!-- 新增一条记录 主键id,--> |
|||
<insert id="insert" parameterType="com.xm.core.entity.XmIterationMenu" useGeneratedKeys="false" keyProperty="id"> |
|||
insert into xm_iteration_menu( |
|||
<include refid="columns"/> |
|||
) values ( |
|||
#{id},#{iterationId},#{menuId},#{productId},#{ctime},#{relStatus},#{hasTask},#{cuserid},#{cusername} |
|||
) |
|||
</insert> |
|||
|
|||
<!-- 按条件删除若干条记录--> |
|||
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmIterationMenu"> |
|||
delete from xm_iteration_menu res |
|||
<where> |
|||
<include refid="where"/> |
|||
</where> |
|||
</delete> |
|||
|
|||
<!-- 按主键删除一条记录--> |
|||
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmIterationMenu"> |
|||
delete from xm_iteration_menu |
|||
where id = #{id} |
|||
</delete> |
|||
|
|||
<!-- 根据条件修改若干条记录 --> |
|||
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmIterationMenu"> |
|||
update xm_iteration_menu |
|||
<set> |
|||
<include refid="someFieldSet"/> |
|||
</set> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<!-- 根据主键修改一条记录 --> |
|||
<update id="updateByPk" parameterType="com.xm.core.entity.XmIterationMenu"> |
|||
update xm_iteration_menu |
|||
<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 xm_iteration_menu |
|||
set |
|||
<include refid="batchSet"/> |
|||
where id = #{item.id} |
|||
</foreach> |
|||
</update> |
|||
<!-- 批量删除 --> |
|||
<delete id="batchDelete" parameterType="List"> |
|||
delete from xm_iteration_menu |
|||
where id in |
|||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|||
#{item.id } |
|||
</foreach> |
|||
</delete> |
|||
|
|||
|
|||
<!--sql片段 列--> |
|||
<sql id="columns"> |
|||
id,iteration_id,menu_id,product_id,ctime,rel_status,has_task,cuserid,cusername |
|||
</sql> |
|||
|
|||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|||
<sql id="where"> |
|||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|||
<if test="iterationId != null and iterationId != ''"> and res.iteration_id = #{iterationId} </if> |
|||
<if test="menuId != null and menuId != ''"> and res.menu_id = #{menuId} </if> |
|||
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if> |
|||
<if test="ctime != null"> and TO_CHAR(res.ctime,'YYYY-MM-DD') = TO_CHAR(#{ctime},'YYYY-MM-DD') </if> |
|||
<if test="relStatus != null and relStatus != ''"> and res.rel_status = #{relStatus} </if> |
|||
<if test="hasTask != null and hasTask != ''"> and res.has_task = #{hasTask} </if> |
|||
<if test="cuserid != null and cuserid != ''"> and res.cuserid = #{cuserid} </if> |
|||
<if test="cusername != null and cusername != ''"> and res.cusername = #{cusername} </if> |
|||
</sql> |
|||
<!--sql片段 更新字段 --> |
|||
<sql id="set"> |
|||
iteration_id = #{iterationId}, |
|||
menu_id = #{menuId}, |
|||
product_id = #{productId}, |
|||
ctime = #{ctime}, |
|||
rel_status = #{relStatus}, |
|||
has_task = #{hasTask}, |
|||
cuserid = #{cuserid}, |
|||
cusername = #{cusername} |
|||
</sql> |
|||
<sql id="someFieldSet"> |
|||
<if test="iterationId != null and iterationId != ''"> iteration_id = #{iterationId}, </if> |
|||
<if test="menuId != null and menuId != ''"> menu_id = #{menuId}, </if> |
|||
<if test="productId != null and productId != ''"> product_id = #{productId}, </if> |
|||
<if test="ctime != null"> ctime = #{ctime}, </if> |
|||
<if test="relStatus != null and relStatus != ''"> rel_status = #{relStatus}, </if> |
|||
<if test="hasTask != null and hasTask != ''"> has_task = #{hasTask}, </if> |
|||
<if test="cuserid != null and cuserid != ''"> cuserid = #{cuserid}, </if> |
|||
<if test="cusername != null and cusername != ''"> cusername = #{cusername}, </if> |
|||
</sql> |
|||
<!--sql片段 批量更新 --> |
|||
<sql id="batchSet"> |
|||
iteration_id = #{item.iterationId}, |
|||
menu_id = #{item.menuId}, |
|||
product_id = #{item.productId}, |
|||
ctime = #{item.ctime}, |
|||
rel_status = #{item.relStatus}, |
|||
has_task = #{item.hasTask}, |
|||
cuserid = #{item.cuserid}, |
|||
cusername = #{item.cusername} |
|||
</sql> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue