| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductParams; |
| | | import com.dy.pmsGlobal.pojoPr.PrOrderItem; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrOrderItem record); |
| | | |
| | | int insertSelective(PrOrderItem record); |
| | | |
| | | PrOrderItem selectByPrimaryKey(Long id); |
| | |
| | | package com.dy.pmsGlobal.daoPr; |
| | | |
| | | import com.dy.pmsGlobal.pojoPlt.PltProduct; |
| | | import com.dy.pmsGlobal.pojoPr.PrOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author User |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int deleteLogicById(Long id); |
| | | |
| | | int insertSelective(PrOrder record); |
| | | |
| | | PrOrder selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrOrder record); |
| | | Long selectSomeCount(Map<String, Object> params); |
| | | |
| | | List<PrOrder> selectSome(Map<String, Object> params); |
| | | |
| | | List<PrOrder> selectAll(Map<String, Object> params); |
| | | |
| | | boolean exists(@Param("name") String name, @Param("id") Long id); |
| | | |
| | | int updateByPrimaryKeySelective(PrOrder record); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | public class PrOrder implements BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | * 主键 |
| | | */ |
| | | @NotNull(message="不能为空") |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | public Long id; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @NotEmpty(message = "名称不能为空") |
| | | public String name; |
| | | /** |
| | | * 客户名称 |
| | |
| | | /** |
| | | * 是否删除,1是,0否 |
| | | */ |
| | | public Integer deleted; |
| | | @JSONField(serialize = false) |
| | | public Boolean deleted; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | public String remark; |
| | | |
| | | @NotNull(message = "订单项不能为空") |
| | | public List<PrOrderItem> items; |
| | | |
| | | } |
| | |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @TableName pr_order_item |
| | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @NotNull(message="编号不能为空") |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | /** |
| | |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long orderId; |
| | | /** |
| | | * 产品实体编号 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long proId; |
| | | |
| | | /** |
| | | * 生产数量 |
| | | */ |
| | |
| | | */ |
| | | public Integer completeNumber; |
| | | |
| | | @JSONField(serialize = false) |
| | | public Boolean deleted; |
| | | |
| | | } |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="orderId" column="order_id" jdbcType="BIGINT"/> |
| | | <result property="proId" column="pro_id" jdbcType="BIGINT"/> |
| | | <result property="number" column="number" jdbcType="INTEGER"/> |
| | | <result property="completeNumber" column="complete_number" jdbcType="INTEGER"/> |
| | | <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,order_id,number, |
| | | complete_number |
| | | id,order_id,pro_id,number, |
| | | complete_number, deleted |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | from pr_order_item |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectItems" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order_item |
| | | where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_order_item |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <!--@mbg.generated--> |
| | | insert into pr_order_item ( id,order_id,pro_id,number, |
| | | complete_number, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{orderId,jdbcType=BIGINT}, #{proId,jdbcType=BIGINT}, #{number,jdbcType=INTEGER}, |
| | | #{completeNumber,jdbcType=INTEGER}, #{deleted,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem" useGeneratedKeys="true"> |
| | | insert into pr_order_item |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="orderId != null">order_id,</if> |
| | | <if test="proId != null">pro_id,</if> |
| | | <if test="number != null">number,</if> |
| | | <if test="completeNumber != null">complete_number,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="proId != null">#{proId,jdbcType=BIGINT},</if> |
| | | <if test="number != null">#{number,jdbcType=INTEGER},</if> |
| | | <if test="completeNumber != null">#{completeNumber,jdbcType=INTEGER},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | |
| | | <if test="orderId != null"> |
| | | order_id = #{orderId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="number != null"> |
| | | number = #{number,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="completeNumber != null"> |
| | | complete_number = #{completeNumber,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <result property="deleted" column="deleted" jdbcType="TINYINT"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="BaseResultMap2" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap"> |
| | | <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="selectItems" column="id" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id,name,customer_name, |
| | | director,d_mobile,delivery_date, |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="exists" resultType="java.lang.Boolean"> |
| | | select count(1) from pr_order where name = #{name} |
| | | <if test="id != null"> |
| | | and id != #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSome" resultMap="BaseResultMap2"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startTime != null"> |
| | | and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start}, #{count} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectSomeCount" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startTime != null"> |
| | | and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <select id="selectAll" resultType="com.dy.pmsGlobal.pojoPr.PrOrder"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="customerName != null and customerName != ''"> |
| | | customer_name like concat('%', #{customerName}, '%') and |
| | | </if> |
| | | <if test="director != null and director != ''"> |
| | | director like concat('%', #{director}, '%') and |
| | | </if> |
| | | <if test="startTime != null"> |
| | | and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_order |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <update id="deleteLogicById" parameterType="java.lang.Long"> |
| | | update pr_order set deleted = 1 |
| | | where id = #{id} |
| | | </update> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrder" useGeneratedKeys="true"> |
| | | insert into pr_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | Date date = Date.from(dt.atZone(ZoneId.systemDefault()).toInstant()); |
| | | return date; |
| | | } |
| | | |
| | | |
| | | } |