去掉supermarket_material表
This commit is contained in:
parent
19007047c9
commit
e2c35c5092
|
|
@ -92,25 +92,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectCookMaterialByMaterialId" parameterType="Long" resultMap="CookMaterialResult">
|
<select id="selectCookMaterialByMaterialId" parameterType="Long" resultMap="CookMaterialResult">
|
||||||
<include refid="selectCookMaterialVo"/>
|
<include refid="selectCookMaterialVo"/>
|
||||||
where cm.goods_type = 1 and cm.material_id = #{materialId}
|
<where>
|
||||||
|
cm.material_id = #{materialId}
|
||||||
|
<if test="goodsType != null "> and cm.goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkIsExistByCode" resultType="java.lang.Integer">
|
<select id="checkIsExistByCode" resultType="java.lang.Integer">
|
||||||
select count(1) from cook_material where cm.goods_type = 1 and material_code = #{materialCode}
|
select count(1) from cook_material
|
||||||
<if test="materialId != null and materialId != ''"> and material_id != #{materialId}</if>
|
<where>
|
||||||
|
material_code = #{materialCode}
|
||||||
|
<if test="materialId != null and materialId != ''"> and material_id != #{materialId}</if>
|
||||||
|
<if test="goodsType != null "> and cm.goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkIsExistByName" resultType="java.lang.Integer">
|
<select id="checkIsExistByName" resultType="java.lang.Integer">
|
||||||
select count(1) from cook_material where cm.goods_type = 1 and material_name = #{materialName}
|
select count(1) from cook_material
|
||||||
<if test="materialId != null and materialId != ''"> and material_id != #{materialId}</if>
|
<where>
|
||||||
|
material_name = #{materialName}
|
||||||
|
<if test="materialId != null and materialId != ''"> and material_id != #{materialId}</if>
|
||||||
|
<if test="goodsType != null "> and cm.goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkIsUse" resultType="java.lang.Integer">
|
<select id="checkIsUse" resultType="java.lang.Integer">
|
||||||
select count(1) from cook_dishes_material where cm.goods_type = 1 and material_id
|
select count(1) from cook_dishes_material
|
||||||
in
|
<where>
|
||||||
<foreach item="materialId" collection="materialIds" open="(" separator="," close=")">
|
material_id in
|
||||||
#{materialId}
|
<foreach item="materialId" collection="materialIds" open="(" separator="," close=")">
|
||||||
</foreach>
|
#{materialId}
|
||||||
|
</foreach>
|
||||||
|
<if test="goodsType != null "> and cm.goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCookMaterial" parameterType="com.bonus.canteen.core.cook.domain.CookMaterial" useGeneratedKeys="true" keyProperty="materialId">
|
<insert id="insertCookMaterial" parameterType="com.bonus.canteen.core.cook.domain.CookMaterial" useGeneratedKeys="true" keyProperty="materialId">
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectCookMaterialTypeVo">
|
<sql id="selectCookMaterialTypeVo">
|
||||||
select material_type_id, material_type_name, parent_id, level, area_id, goods_type, create_by, create_time, update_by, update_time from cook_material_type
|
select material_type_id, material_type_name, parent_id, level, area_id, goods_type,
|
||||||
|
create_by, create_time, update_by, update_time
|
||||||
|
from cook_material_type
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectCookMaterialTypeList" parameterType="com.bonus.canteen.core.cook.domain.CookMaterialType" resultMap="CookMaterialTypeResult">
|
<select id="selectCookMaterialTypeList" parameterType="com.bonus.canteen.core.cook.domain.CookMaterialType" resultMap="CookMaterialTypeResult">
|
||||||
|
|
@ -34,28 +36,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectCookMaterialTypeByMaterialTypeId" parameterType="Long" resultMap="CookMaterialTypeResult">
|
<select id="selectCookMaterialTypeByMaterialTypeId" parameterType="Long" resultMap="CookMaterialTypeResult">
|
||||||
<include refid="selectCookMaterialTypeVo"/>
|
<include refid="selectCookMaterialTypeVo"/>
|
||||||
where goods_type = 1 and material_type_id = #{materialTypeId}
|
<where>
|
||||||
|
material_type_id = #{materialTypeId}
|
||||||
|
<if test="goodsType != null "> and goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCookMaterialTypeByMaterialTypeName"
|
<select id="selectCookMaterialTypeByMaterialTypeName"
|
||||||
resultType="com.bonus.canteen.core.cook.domain.CookMaterialType">
|
resultType="com.bonus.canteen.core.cook.domain.CookMaterialType">
|
||||||
<include refid="selectCookMaterialTypeVo"/>
|
<include refid="selectCookMaterialTypeVo"/>
|
||||||
where goods_type = 1 and material_type_name = #{materialTypeName}
|
<where>
|
||||||
<if test="materialTypeId != null and materialTypeId != ''">and material_type_id != #{materialTypeId}</if>
|
material_type_name = #{materialTypeName}
|
||||||
|
<if test="materialTypeId != null and materialTypeId != ''">and material_type_id != #{materialTypeId}</if>
|
||||||
|
<if test="goodsType != null "> and goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCookMaterialTypeByParentId" resultType="java.lang.Integer">
|
<select id="selectCookMaterialTypeByParentId" resultType="java.lang.Integer">
|
||||||
select count(1) from cook_material_type where goods_type = 1 and parent_id in
|
select count(1) from cook_material_type
|
||||||
<foreach item="materialTypeId" collection="materialTypeIds" open="(" separator="," close=")">
|
<where>
|
||||||
#{materialTypeId}
|
parent_id in
|
||||||
</foreach>
|
<foreach item="materialTypeId" collection="materialTypeIds" open="(" separator="," close=")">
|
||||||
|
#{materialTypeId}
|
||||||
|
</foreach>
|
||||||
|
<if test="goodsType != null "> and goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTree" resultType="com.bonus.canteen.core.cook.vo.CookMaterialTypeTreeVO">
|
<select id="getTree" resultType="com.bonus.canteen.core.cook.vo.CookMaterialTypeTreeVO">
|
||||||
select material_type_id as id, parent_id as parentId, material_type_name as categoryName,
|
select material_type_id as id, parent_id as parentId, material_type_name as categoryName,
|
||||||
goods_type as categoryType,area_id as areaId
|
goods_type as categoryType,area_id as areaId
|
||||||
from cook_material_type
|
from cook_material_type
|
||||||
where goods_type = 1
|
<where>
|
||||||
|
<if test="goodsType != null "> and goods_type = #{goodsType}</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCookMaterialType" parameterType="com.bonus.canteen.core.cook.domain.CookMaterialType" useGeneratedKeys="true" keyProperty="materialTypeId">
|
<insert id="insertCookMaterialType" parameterType="com.bonus.canteen.core.cook.domain.CookMaterialType" useGeneratedKeys="true" keyProperty="materialTypeId">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue