feat: 智聪记账管理,物价管理-商品信息管理代码提交。
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?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.intc.invest.mapper.ProductInforMapper">
|
||||
|
||||
<resultMap type="ProductInforVo" id="ProductInforResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="category" column="category" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="fields" column="fields" />
|
||||
<result property="ranking" column="ranking" />
|
||||
<result property="code" column="code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProductInforVo">
|
||||
select a.id, a.name, a.category, a.unit, a.remark, a.create_time, a.create_by, a.update_time, a.updated_by, a.del_flag, a.fields, a.ranking, a.code from product_infor a
|
||||
</sql>
|
||||
|
||||
<select id="selectProductInforList" parameterType="ProductInforDto" resultMap="ProductInforResult">
|
||||
<include refid="selectProductInforVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
||||
<if test="category != null and category != ''"> and a.category = #{category}</if>
|
||||
<if test="unit != null and unit != ''"> and a.unit = #{unit}</if>
|
||||
</where>
|
||||
order by a.ranking asc,a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectProductInforById" parameterType="Long" resultMap="ProductInforResult">
|
||||
<include refid="selectProductInforVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProductInfor" parameterType="ProductInfor">
|
||||
insert into product_infor
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="category != null and category != ''">category,</if>
|
||||
<if test="unit != null and unit != ''">unit,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="fields != null">fields,</if>
|
||||
<if test="ranking != null">ranking,</if>
|
||||
<if test="code != null">code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="category != null and category != ''">#{category},</if>
|
||||
<if test="unit != null and unit != ''">#{unit},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="fields != null">#{fields},</if>
|
||||
<if test="ranking != null">#{ranking},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProductInfor" parameterType="ProductInfor">
|
||||
update product_infor
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="category != null and category != ''">category = #{category},</if>
|
||||
<if test="unit != null and unit != ''">unit = #{unit},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="fields != null">fields = #{fields},</if>
|
||||
<if test="ranking != null">ranking = #{ranking},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProductInforById" parameterType="Long">
|
||||
delete from product_infor where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProductInforByIds" parameterType="String">
|
||||
delete from product_infor where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeProductInforById" parameterType="Long">
|
||||
update product_infor set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeProductInforByIds" parameterType="String">
|
||||
update product_infor set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user