<?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.example.erp.mapper.mm.MaterialStoreMapper">
|
|
<select id="getSelectMaterialStore">
|
select
|
*
|
from
|
mm.material_store m
|
<where>
|
<if test="materialStore.id != null and materialStore.id != ''">
|
and m.id regexp #{materialStore.id}
|
</if>
|
<if test="materialStore.type != null and materialStore.type != ''">
|
and m.type regexp #{materialStore.type}
|
</if>
|
</where>
|
limit #{offset},#{pageSize};
|
</select>
|
|
<select id="getSelectMaterialStoreById">
|
select * from mm.material_store m where id=#{id}
|
</select>
|
|
<select id="getSelectMaterialStorePageTotal">
|
select
|
CEILING(count(id)/#{pageSize}) as 'pageTotal',
|
count(id) as 'total'
|
from
|
mm.material_store m
|
<where>
|
<if test="materialStore.id != null and materialStore.id != ''">
|
and m.id regexp #{materialStore.id}
|
</if>
|
<if test="materialStore.type != null and materialStore.type != ''">
|
and m.type regexp #{materialStore.type}
|
</if>
|
</where>
|
limit #{offset},#{pageSize};
|
</select>
|
|
<insert id="insertMaterialStore" useGeneratedKeys="true" >
|
insert into mm.material_store (type,json,create_time
|
)
|
values (
|
#{type},#{json},now()
|
)
|
</insert>
|
|
<update id="updateMaterialStore" >
|
update mm.material_store set json=#{json} where id=#{id}
|
</update>
|
|
<delete id="deleteMaterialStore" >
|
delete from mm.material_store where id=#{id}
|
</delete>
|
|
|
|
|
</mapper>
|