feat(cost): 添加成本管理系统核心功能模块
- 实现成本项目配置管理,包括增删改查和导出功能 - 实现成本单价历史记录功能,支持按时间追溯价格变化 - 实现生产成本明细管理,记录各班次的详细成本数据 - 集成权限控制和操作日志记录功能 - 提供完整的CRUD接口和数据持久化支持 - 集成Excel导入导出功能便于数据统计分析
This commit is contained in:
100
ruoyi-cost/src/main/resources/mapper/cost/CostItemMapper.xml
Normal file
100
ruoyi-cost/src/main/resources/mapper/cost/CostItemMapper.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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.ruoyi.cost.mapper.CostItemMapper">
|
||||
|
||||
<resultMap type="CostItem" id="CostItemResult">
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="category" column="category" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="queryCondition" column="query_condition" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostItemVo">
|
||||
select item_id, item_code, item_name, category, unit, remark, query_condition, del_flag, create_by, create_time, update_by, update_time from cost_item
|
||||
</sql>
|
||||
|
||||
<select id="selectCostItemList" parameterType="CostItem" resultMap="CostItemResult">
|
||||
<include refid="selectCostItemVo"/>
|
||||
<where>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="queryCondition != null and queryCondition != ''"> and query_condition = #{queryCondition}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostItemByItemId" parameterType="Long" resultMap="CostItemResult">
|
||||
<include refid="selectCostItemVo"/>
|
||||
where item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostItem" parameterType="CostItem" useGeneratedKeys="true" keyProperty="itemId">
|
||||
insert into cost_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="queryCondition != null">query_condition,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="queryCondition != null">#{queryCondition},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostItem" parameterType="CostItem">
|
||||
update cost_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="queryCondition != null">query_condition = #{queryCondition},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostItemByItemId" parameterType="Long">
|
||||
delete from cost_item where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostItemByItemIds" parameterType="String">
|
||||
delete from cost_item where item_id in
|
||||
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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.ruoyi.cost.mapper.CostPriceMapper">
|
||||
|
||||
<resultMap type="CostPrice" id="CostPriceResult">
|
||||
<result property="priceId" column="price_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="price" column="price" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostPriceVo">
|
||||
select price_id, item_id, price, effective_date, remark, del_flag, create_by, create_time, update_by, update_time from cost_price
|
||||
</sql>
|
||||
|
||||
<select id="selectCostPriceList" parameterType="CostPrice" resultMap="CostPriceResult">
|
||||
<include refid="selectCostPriceVo"/>
|
||||
<where>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="effectiveDate != null "> and effective_date = #{effectiveDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostPriceByPriceId" parameterType="Long" resultMap="CostPriceResult">
|
||||
<include refid="selectCostPriceVo"/>
|
||||
where price_id = #{priceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostPrice" parameterType="CostPrice" useGeneratedKeys="true" keyProperty="priceId">
|
||||
insert into cost_price
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="effectiveDate != null">effective_date,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="effectiveDate != null">#{effectiveDate},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostPrice" parameterType="CostPrice">
|
||||
update cost_price
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where price_id = #{priceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostPriceByPriceId" parameterType="Long">
|
||||
delete from cost_price where price_id = #{priceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostPriceByPriceIds" parameterType="String">
|
||||
delete from cost_price where price_id in
|
||||
<foreach item="priceId" collection="array" open="(" separator="," close=")">
|
||||
#{priceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,110 @@
|
||||
<?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.ruoyi.cost.mapper.CostProdDetailMapper">
|
||||
|
||||
<resultMap type="CostProdDetail" id="CostProdDetailResult">
|
||||
<result property="detailId" column="detail_id" />
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="shift" column="shift" />
|
||||
<result property="detailDate" column="detail_date" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdDetailVo">
|
||||
select detail_id, report_id, shift, detail_date, item_id, quantity, unit_price, amount, remark, del_flag, create_by, create_time, update_by, update_time from cost_prod_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdDetailList" parameterType="CostProdDetail" resultMap="CostProdDetailResult">
|
||||
<include refid="selectCostProdDetailVo"/>
|
||||
<where>
|
||||
<if test="reportId != null "> and report_id = #{reportId}</if>
|
||||
<if test="shift != null and shift != ''"> and shift = #{shift}</if>
|
||||
<if test="detailDate != null "> and detail_date = #{detailDate}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="amount != null "> and amount = #{amount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdDetailByDetailId" parameterType="Long" resultMap="CostProdDetailResult">
|
||||
<include refid="selectCostProdDetailVo"/>
|
||||
where detail_id = #{detailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdDetail" parameterType="CostProdDetail" useGeneratedKeys="true" keyProperty="detailId">
|
||||
insert into cost_prod_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id,</if>
|
||||
<if test="shift != null">shift,</if>
|
||||
<if test="detailDate != null">detail_date,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">#{reportId},</if>
|
||||
<if test="shift != null">#{shift},</if>
|
||||
<if test="detailDate != null">#{detailDate},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdDetail" parameterType="CostProdDetail">
|
||||
update cost_prod_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id = #{reportId},</if>
|
||||
<if test="shift != null">shift = #{shift},</if>
|
||||
<if test="detailDate != null">detail_date = #{detailDate},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where detail_id = #{detailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdDetailByDetailId" parameterType="Long">
|
||||
delete from cost_prod_detail where detail_id = #{detailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdDetailByDetailIds" parameterType="String">
|
||||
delete from cost_prod_detail where detail_id in
|
||||
<foreach item="detailId" collection="array" open="(" separator="," close=")">
|
||||
#{detailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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.ruoyi.cost.mapper.CostProdMetricMapper">
|
||||
|
||||
<resultMap type="CostProdMetric" id="CostProdMetricResult">
|
||||
<result property="metricId" column="metric_id" />
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="metricCode" column="metric_code" />
|
||||
<result property="metricName" column="metric_name" />
|
||||
<result property="metricFormula" column="metric_formula" />
|
||||
<result property="metricValue" column="metric_value" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdMetricVo">
|
||||
select metric_id, report_id, metric_code, metric_name, metric_formula, metric_value, remark, del_flag, create_by, create_time, update_by, update_time from cost_prod_metric
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdMetricList" parameterType="CostProdMetric" resultMap="CostProdMetricResult">
|
||||
<include refid="selectCostProdMetricVo"/>
|
||||
<where>
|
||||
<if test="reportId != null "> and report_id = #{reportId}</if>
|
||||
<if test="metricCode != null and metricCode != ''"> and metric_code = #{metricCode}</if>
|
||||
<if test="metricName != null and metricName != ''"> and metric_name like concat('%', #{metricName}, '%')</if>
|
||||
<if test="metricFormula != null and metricFormula != ''"> and metric_formula = #{metricFormula}</if>
|
||||
<if test="metricValue != null "> and metric_value = #{metricValue}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdMetricByMetricId" parameterType="Long" resultMap="CostProdMetricResult">
|
||||
<include refid="selectCostProdMetricVo"/>
|
||||
where metric_id = #{metricId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdMetric" parameterType="CostProdMetric" useGeneratedKeys="true" keyProperty="metricId">
|
||||
insert into cost_prod_metric
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id,</if>
|
||||
<if test="metricCode != null">metric_code,</if>
|
||||
<if test="metricName != null">metric_name,</if>
|
||||
<if test="metricFormula != null">metric_formula,</if>
|
||||
<if test="metricValue != null">metric_value,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportId != null">#{reportId},</if>
|
||||
<if test="metricCode != null">#{metricCode},</if>
|
||||
<if test="metricName != null">#{metricName},</if>
|
||||
<if test="metricFormula != null">#{metricFormula},</if>
|
||||
<if test="metricValue != null">#{metricValue},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdMetric" parameterType="CostProdMetric">
|
||||
update cost_prod_metric
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportId != null">report_id = #{reportId},</if>
|
||||
<if test="metricCode != null">metric_code = #{metricCode},</if>
|
||||
<if test="metricName != null">metric_name = #{metricName},</if>
|
||||
<if test="metricFormula != null">metric_formula = #{metricFormula},</if>
|
||||
<if test="metricValue != null">metric_value = #{metricValue},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where metric_id = #{metricId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdMetricByMetricId" parameterType="Long">
|
||||
delete from cost_prod_metric where metric_id = #{metricId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdMetricByMetricIds" parameterType="String">
|
||||
delete from cost_prod_metric where metric_id in
|
||||
<foreach item="metricId" collection="array" open="(" separator="," close=")">
|
||||
#{metricId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.ruoyi.cost.mapper.CostProdReportMapper">
|
||||
|
||||
<resultMap type="CostProdReport" id="CostProdReportResult">
|
||||
<result property="reportId" column="report_id" />
|
||||
<result property="reportTitle" column="report_title" />
|
||||
<result property="reportDate" column="report_date" />
|
||||
<result property="lineType" column="line_type" />
|
||||
<result property="inputWeight" column="input_weight" />
|
||||
<result property="outputWeight" column="output_weight" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="colConfig" column="col_config" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCostProdReportVo">
|
||||
select report_id, report_title, report_date, line_type, input_weight, output_weight, remark, del_flag, create_by, create_time, update_by, update_time, col_config from cost_prod_report
|
||||
</sql>
|
||||
|
||||
<select id="selectCostProdReportList" parameterType="CostProdReport" resultMap="CostProdReportResult">
|
||||
<include refid="selectCostProdReportVo"/>
|
||||
<where>
|
||||
<if test="reportTitle != null and reportTitle != ''"> and report_title = #{reportTitle}</if>
|
||||
<if test="reportDate != null "> and report_date = #{reportDate}</if>
|
||||
<if test="lineType != null and lineType != ''"> and line_type = #{lineType}</if>
|
||||
<if test="inputWeight != null "> and input_weight = #{inputWeight}</if>
|
||||
<if test="outputWeight != null "> and output_weight = #{outputWeight}</if>
|
||||
<if test="colConfig != null and colConfig != ''"> and col_config = #{colConfig}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCostProdReportByReportId" parameterType="Long" resultMap="CostProdReportResult">
|
||||
<include refid="selectCostProdReportVo"/>
|
||||
where report_id = #{reportId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCostProdReport" parameterType="CostProdReport" useGeneratedKeys="true" keyProperty="reportId">
|
||||
insert into cost_prod_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="reportTitle != null">report_title,</if>
|
||||
<if test="reportDate != null">report_date,</if>
|
||||
<if test="lineType != null">line_type,</if>
|
||||
<if test="inputWeight != null">input_weight,</if>
|
||||
<if test="outputWeight != null">output_weight,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="colConfig != null">col_config,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="reportTitle != null">#{reportTitle},</if>
|
||||
<if test="reportDate != null">#{reportDate},</if>
|
||||
<if test="lineType != null">#{lineType},</if>
|
||||
<if test="inputWeight != null">#{inputWeight},</if>
|
||||
<if test="outputWeight != null">#{outputWeight},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="colConfig != null">#{colConfig},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCostProdReport" parameterType="CostProdReport">
|
||||
update cost_prod_report
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="reportTitle != null">report_title = #{reportTitle},</if>
|
||||
<if test="reportDate != null">report_date = #{reportDate},</if>
|
||||
<if test="lineType != null">line_type = #{lineType},</if>
|
||||
<if test="inputWeight != null">input_weight = #{inputWeight},</if>
|
||||
<if test="outputWeight != null">output_weight = #{outputWeight},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="colConfig != null">col_config = #{colConfig},</if>
|
||||
</trim>
|
||||
where report_id = #{reportId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCostProdReportByReportId" parameterType="Long">
|
||||
delete from cost_prod_report where report_id = #{reportId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCostProdReportByReportIds" parameterType="String">
|
||||
delete from cost_prod_report where report_id in
|
||||
<foreach item="reportId" collection="array" open="(" separator="," close=")">
|
||||
#{reportId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user