Commit 2686c6f7 authored by 高滢's avatar 高滢

样品管理 增删改查 规范

parent 8a62313e
......@@ -20,7 +20,7 @@ import lombok.Data;
*/
@ApiModel
@TableName(value ="t_sample_management")
@TableName(value ="t_sample")
@Data
public class SampleManagement extends BaseEntity
{
......@@ -75,12 +75,8 @@ public class SampleManagement extends BaseEntity
@ApiModelProperty("0:整车样品 1:零部件样品")
private String flag;
/** 逻辑删除(0-存在,1-删除) */
@ApiModelProperty("0-存在,1-删除")
private String delFlag;
/** 生产企业名称*/
@ApiModelProperty("0-存在,1-删除")
@ApiModelProperty("生产企业名称")
private String enterpriseName;
/** 商标 */
......
......@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="deleted" column="deleted" />
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="remark" column="remark" />
......@@ -42,40 +42,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sm.create_time,
sm.update_by,
sm.update_time,
sm.del_flag,
sm.deleted,
sm.enterprise_id,
sm.remark,
sm.trademark,
sm.sample_photos,
ae.enterprise_name
from t_sample_management sm
from t_sample sm
left join t_automobile_enterprise ae on ae.id = sm.enterprise_id
</sql>
<select id="selectSampleManagementList" parameterType="com.ruoyi.domain.SampleManagement" resultMap="SampleManagementResult">
<include refid="selectTSampleManagementVo"/>
<where>
del_flag = '0'
<if test="identificationCode != null and identificationCode != ''"> and identification_code like concat('%', #{identificationCode}, '%')</if>
<if test="sampleNumber != null and sampleNumber != ''"> and sample_number like concat('%', #{sampleNumber}, '%')</if>
<if test="sampleName != null and sampleName != ''"> and sample_name like concat('%', #{sampleName}, '%')</if>
<if test="flag != null and flag != ''"> flag = #{flag} </if>
sm.deleted = 0
<if test="identificationCode != null and identificationCode != ''"> and sm.identification_code like concat('%', #{identificationCode}, '%')</if>
<if test="sampleNumber != null and sampleNumber != ''"> and sm.sample_number like concat('%', #{sampleNumber}, '%')</if>
<if test="sampleName != null and sampleName != ''"> and sm.sample_name like concat('%', #{sampleName}, '%')</if>
<if test="flag != null and flag != ''"> sm.flag = #{flag} </if>
</where>
</select>
<select id="selectSampleManagementById" parameterType="Long" resultMap="SampleManagementResult">
<include refid="selectTSampleManagementVo"/>
where id = #{id}
where sm.id = #{id}
</select>
<insert id="insertSampleManagement" parameterType="com.ruoyi.domain.SampleManagement" useGeneratedKeys="true" keyProperty="id">
insert into t_sample_management
insert into t_sample
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="identificationCode != null">identification_code,</if>
<if test="sampleNumber != null">sample_number,</if>
<if test="sampleName != null">sample_name,</if>
<if test="sampleSender != null">sample_sender,</if>
<if test="number OfSamples != null">number_of_samples,</if>
<if test="numberOfSamples != null">number_of_samples,</if>
<if test="deliveryDate != null">delivery_date,</if>
<if test="manufactureDate != null">manufacture_date,</if>
<if test="manufacturingEnterprise != null">manufacturing_enterprise,</if>
......@@ -84,18 +84,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="enterpriseId != null">enterprise_id,</if>
<if test="remark != null">remark,</if>
<if test="trademark != null">trademark,</if>
<if test="samplePhotos != null">sample_photos,</if>
<if test="deleted != null">deleted,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="identificationCode != null">#{identificationCode},</if>
<if test="sampleNumber != null">#{sampleNumber},</if>
<if test="sampleName != null">#{sampleName},</if>
<if test="sampleSender != null">#{sampleSender},</if>
<if test="number OfSamples != null">#{number OfSamples},</if>
<if test="numberOfSamples != null">#{numberOfSamples},</if>
<if test="deliveryDate != null">#{deliveryDate},</if>
<if test="manufactureDate != null">#{manufactureDate},</if>
<if test="manufacturingEnterprise != null">#{manufacturingEnterprise},</if>
......@@ -104,22 +104,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="enterpriseId != null">#{enterpriseId}</if>
<if test="remark != null">#{remark},</if>
<if test="trademark != null">#{trademark},</if>
<if test="samplePhotos != null">#{samplePhotos},</if>
<if test="deleted != null">#{deleted},</if>
</trim>
</insert>
<update id="updateSampleManagement" parameterType="com.ruoyi.domain.SampleManagement">
update t_sample_management
update t_sample
<trim prefix="SET" suffixOverrides=",">
<if test="identificationCode != null">identification_code = #{identificationCode},</if>
<if test="sampleNumber != null">sample_number = #{sampleNumber},</if>
<if test="sampleName != null">sample_name = #{sampleName},</if>
<if test="sampleSender != null">sample_sender = #{sampleSender},</if>
<if test="number OfSamples != null">number_of_samples = #{number OfSamples},</if>
<if test="numberOfSamples != null">number_of_samples = #{numberOfSamples},</if>
<if test="deliveryDate != null">delivery_date = #{deliveryDate},</if>
<if test="manufactureDate != null">manufacture_date = #{manufactureDate},</if>
<if test="manufacturingEnterprise != null">manufacturing_enterprise = #{manufacturingEnterprise},</if>
......@@ -128,7 +128,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="delFlag != null">del_flag = #{delFlag},</if>
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="trademark != null">trademark = #{trademark},</if>
......@@ -138,14 +137,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteSampleManagementById" parameterType="Long">
update t_sample_management set del_flag = '1',
update t_sample set deleted = 1,
where id = #{id}
</delete>
<select id="selectIdentificationCodeCount" parameterType="com.ruoyi.domain.SampleManagement" resultType="integer">
select count(id) from t_sample_management
select count(id) from t_sample
<where>
del_flag = '0'
deleted = 0
<if test="flag != null and flag != ''">and flag = #{flag}</if>
<if test="identificationCode != null and identificationCode != ''"> and identification_code = #{identificationCode}</if>
<if test="id != null and id != ''">and id != #{id}</if>
......@@ -153,9 +152,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectSampleNumberCount" parameterType="com.ruoyi.domain.SampleManagement" resultType="integer">
select count(id) from t_sample_management
select count(id) from t_sample
<where>
del_flag = '0'
deleted = 0
<if test="flag != null and flag != ''">and flag = #{flag}</if>
<if test="sampleNumber != null and sampleNumber != ''"> and sample_number = #{sampleNumber}</if>
<if test="id != null and id != ''">and id != #{id}</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment