新购接口优化

This commit is contained in:
sxu 2024-11-15 16:21:59 +08:00
parent 6181dc542c
commit c81bfa0a11
2 changed files with 35 additions and 12 deletions

View File

@ -1,11 +1,14 @@
package com.bonus.material.purchase.domain;
import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
import java.util.Date;
/**
* 新购验收编号管理对象 purchase_macode_info
*
@ -61,5 +64,18 @@ public class PurchaseMacodeInfo extends BaseEntity {
@ApiModelProperty(value = "数据所属组织")
private Long companyId;
@ApiModelProperty(value = "物资单位名称")
private String unitName;
@ApiModelProperty(value = "规格名称")
private String typeName;
@ApiModelProperty(value = "物资名称--规格parent类型")
private String maTypeName;
/** 出厂日期 */
@ApiModelProperty(value = "出厂日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productionTime;
}

View File

@ -18,31 +18,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
<result property="unitName" column="unit_name" />
<result property="typeName" column="type_name" />
<result property="maTypeName" column="ma_type_name" />
<result property="productionTime" column="production_time" />
</resultMap>
<sql id="selectPurchaseMacodeInfoVo">
select id, task_id, type_id, ma_code, qr_code, fix_code, code_type, status,
create_by, create_time, update_by, update_time, remark, company_id
from purchase_macode_info
select pmi.id, pmi.task_id, pmi.type_id, pmi.ma_code, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
pmi.create_by, pmi.create_time, pmi.update_by, pmi.update_time, pmi.remark, pmi.company_id,
mt.type_name, mt.unit_name, mtp.type_name as ma_type_name
from purchase_macode_info pmi
left join ma_type mt on pmi.type_id = mt.type_id
left join ma_type mtp on mt.parent_id = mtp.type_id
</sql>
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult">
<include refid="selectPurchaseMacodeInfoVo"/>
<where>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="typeId != null "> and type_id = #{typeId}</if>
<if test="maCode != null and maCode != ''"> and ma_code = #{maCode}</if>
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
<if test="fixCode != null and fixCode != ''"> and fix_code = #{fixCode}</if>
<if test="codeType != null and codeType != ''"> and code_type = #{codeType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="taskId != null "> and pmi.task_id = #{taskId}</if>
<if test="typeId != null "> and pmi.type_id = #{typeId}</if>
<if test="maCode != null and maCode != ''"> and pmi.ma_code = #{maCode}</if>
<if test="qrCode != null and qrCode != ''"> and pmi.qr_code = #{qrCode}</if>
<if test="fixCode != null and fixCode != ''"> and pmi.fix_code = #{fixCode}</if>
<if test="codeType != null and codeType != ''"> and pmi.code_type = #{codeType}</if>
<if test="status != null and status != ''"> and pmi.status = #{status}</if>
<if test="companyId != null "> and pmi.company_id = #{companyId}</if>
</where>
</select>
<select id="selectPurchaseMacodeInfoById" parameterType="Long" resultMap="PurchaseMacodeInfoResult">
<include refid="selectPurchaseMacodeInfoVo"/>
where id = #{id}
where pmi.id = #{id}
</select>
<insert id="insertPurchaseMacodeInfo" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" useGeneratedKeys="true" keyProperty="id">